HTTP exposes a variety of settings. Several of these settings are available for configuration within individual receivers or exporters.
Exporters leverage client configuration.
Note that client configuration supports TLS configuration, the
configuration parameters are also defined under tls like server
configuration. For more information, see configtls
README.
endpoint: address:portproxy_url: Proxy URL to use for HTTP requeststlsheaders: name/value pairs added to the HTTP request headers- certain headers such as Content-Length and Connection are automatically written when needed and values in Header may be ignored.
Hostheader is automatically derived fromendpointvalue. However, this automatic assignment can be overridden by explicitly setting the Host field in the headers field.- if
Hostheader is provided then it overridesHostfield in Request which results as an override ofHostheader value.
read_buffer_sizetimeoutwrite_buffer_sizecompression: Compression type to use amonggzip,zstd,snappy,zlib,deflate, andlz4.- look at the documentation for the server-side of the communication.
nonewill be treated as uncompressed, and any other inputs will cause an error.
compression_params: Configure advanced compression optionslevel: Configure compression level forcompressiontype- The following are valid combinations of
compressionandlevelgzip- BestSpeed:
1 - BestCompression:
9 - DefaultCompression:
-1
- BestSpeed:
zlib- BestSpeed:
1 - BestCompression:
9 - DefaultCompression:
-1
- BestSpeed:
deflate- BestSpeed:
1 - BestCompression:
9 - DefaultCompression:
-1
- BestSpeed:
zstd- SpeedFastest:
1 - SpeedDefault:
3 - SpeedBetterCompression:
6 - SpeedBestCompression:
11
- SpeedFastest:
snappyNo compression levels supported yetx-snappy-framed(When feature gateconfighttp.framedSnappyis enabled) No compression levels supported yet
max_idle_connsmax_idle_conns_per_hostmax_conns_per_hostidle_conn_timeoutauthdisable_keep_alivesforce_attempt_http2http2_read_idle_timeouthttp2_ping_timeoutcookies- [
enabled] if enabled, the client will store cookies from server responses and reuse them in subsequent requests.
- [
middlewares
Example:
exporter:
otlp_http:
endpoint: otelcol2:55690
auth:
authenticator: some-authenticator-extension
tls:
ca_file: ca.pem
cert_file: cert.pem
key_file: key.pem
headers:
test1: "value1"
"test 2": "value 2"
compression: gzip
compression_params:
level: 1
cookies:
enabled: trueReceivers leverage server configuration.
cors: Configure CORS, allowing the receiver to accept traces from web browsers, even if the receiver is hosted at a different origin. If left blank or set tonull, CORS will not be enabled.allowed_origins: A list of origins allowed to send requests to the receiver. An origin may contain a wildcard (*) to replace 0 or more characters (e.g.,https://*.example.com). Do not use a plain wildcard["*"], as our CORS response includesAccess-Control-Allow-Credentials: true, which makes browsers to disallow a plain wildcard (this is a security standard). To allow any origin, you can specify at least the protocol, for example["https://*", "http://*"]. If no origins are listed, CORS will not be enabled.allowed_headers: Allow CORS requests to include headers outside the default safelist. By default, safelist headers andX-Requested-Withwill be allowed. To allow any request header, set to["*"].exposed_headers: Sets the value of theAccess-Control-Expose-Headersresponse header, indicating which headers are safe to expose to the API of a CORS response.max_age: Sets the value of theAccess-Control-Max-Ageheader, allowing clients to cache the response to CORS preflight requests. If not set, browsers use a default of 5 seconds.
endpoint: Valid value syntax available heretransport: The transport protocol to use. Defaults totcp. See the confignet README for more information.max_request_body_size: configures the maximum allowed body size in bytes for a single request. Default:20971520(20MiB)include_metadata: propagates the client metadata from the incoming requests to the downstream consumers. Default:falseresponse_headers: Additional headers attached to each HTTP response sent to the client. Header values are opaque since they may be sensitivecompression_algorithms: configures the list of compression algorithms the server can accept. Default: ["", "gzip", "zstd", "zlib", "snappy", "deflate", "lz4"]x-snappy-framedcan be used if feature gateconfighttp.snappyFramedis enabled.
read_timeout: maximum duration for reading the entire request, including the body. A zero or negative value means there will be no timeout. Default:0(no timeout)read_header_timeout: amount of time allowed to read request headers. If zero, the value ofread_timeoutis used. If both are zero, there is no timeout. Default:1mwrite_timeout: maximum duration before timing out writes of the response. A zero or negative value means there will be no timeout. Default:30sidle_timeout: maximum amount of time to wait for the next request when keep-alives are enabled. If zero, the value ofread_timeoutis used. If both are zero, there is no timeout. Default:1mkeep_alives_enabled: controls whether HTTP keep-alives are enabled. Default:truetlsauthrequest_params: a list of query parameter names to add to the auth context, along with the HTTP headers
middlewares
You can enable attribute processor to append any http header to span's attribute using custom key. You also need to enable the "include_metadata"
Example:
receivers:
otlp:
protocols:
http:
include_metadata: true
auth:
request_params:
- token
authenticator: some-authenticator-extension
cors:
allowed_origins:
- https://foo.bar.com
- https://*.test.com
allowed_headers:
- Example-Header
exposed_headers:
- Example-Expose-Header
max_age: 7200
endpoint: 0.0.0.0:55690
compression_algorithms: ["", "gzip"]
processors:
attributes:
actions:
- key: http.client_ip
from_context: metadata.x-forwarded-for
action: upsert