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:porttls
headers
: name/value pairs added to the HTTP request headersread_buffer_size
timeout
write_buffer_size
compression
: Compression type to use amonggzip
,zstd
,snappy
,zlib
, anddeflate
.- look at the documentation for the server-side of the communication.
none
will be treated as uncompressed, and any other inputs will cause an error.
max_idle_conns
max_idle_conns_per_host
max_conns_per_host
idle_conn_timeout
Example:
exporter:
otlp:
endpoint: otelcol2:55690
tls:
ca_file: ca.pem
cert_file: cert.pem
key_file: key.pem
headers:
test1: "value1"
"test 2": "value 2"
compression: zstd
Receivers 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
). To allow any origin, set to["*"]
. 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-With
will be allowed. To allow any request header, set to["*"]
.max_age
: Sets the value of theAccess-Control-Max-Age
header, 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 heretls
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
cors:
allowed_origins:
- https://foo.bar.com
- https://*.test.com
allowed_headers:
- Example-Header
max_age: 7200
endpoint: 0.0.0.0:55690
processors:
attributes:
actions:
- key: http.client_ip
from_context: X-Forwarded-For
action: upsert