View Source opentelemetry_exporter (opentelemetry_exporter v1.8.0)
This is the module providing the OpenTelemetry protocol for exporting traces. It can be configured through its application environment, the OS environment or directly through a map of options passed when setting up the exporter in the batch processor.
opentelemetry_exporter
application environment options are:
otlp_endpoint
: The URL to send traces and metrics to, for traces the pathv1/traces
is appended to the path in the URL.otlp_traces_endpoint
: URL to send only traces to. This takes precedence for exporting traces and the path of the URL is kept as is, no suffix is appended.otlp_headers
: List of additional headers ([{unicode:chardata(), unicode:chardata()}]
) to add to export requests.otlp_traces_headers
: Additional headers ([{unicode:chardata(), unicode:chardata()}]
) to add to only trace export requests.otlp_protocol
: The transport protocol, supported values:grpc
andhttp_protobuf
. Defaults tohttp_protobuf
.otlp_traces_protocol
: The transport protocol to use for exporting traces, supported values:grpc
andhttp_protobuf
. Defaults tohttp_protobuf
otlp_compression
: Compression type to use, supported values:gzip
. Defaults to no compression.otlp_traces_compression
: Compression type to use for exporting traces, supported values:gzip
. Defaults to no compression.
There also corresponding OS environment variables can also set those configuration values:
OTEL_EXPORTER_OTLP_ENDPOINT
: The URL to send traces and metrics to, for traces the pathv1/traces
is appended to the path in the URL.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT
: URL to send only traces to. This takes precedence for exporting traces and the path of the URL is kept as is, no suffix is appended.OTEL_EXPORTER_OTLP_HEADERS
: List of additional headers to add to export requests.OTEL_EXPORTER_OTLP_TRACES_HEADERS
: Additional headers to add to only trace export requests.OTEL_EXPORTER_OTLP_PROTOCOL
: The transport protocol to use, supported values:grpc
andhttp_protobuf
. Defaults tohttp_protobuf
.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL
: The transport protocol to use for exporting traces, supported values:grpc
andhttp_protobuf
. Defaults tohttp_protobuf
.OTEL_EXPORTER_OTLP_COMPRESSION
: Compression to use, supported value: gzip. Defaults to no compression.OTEL_EXPORTER_OTLP_TRACES_COMPRESSION
: Compression to use when exporting traces, supported value: gzip. Defaults to no compression.
endpoints
: A list of endpoints to send traces to. Can take one of the forms described below. By default, exporter sends data tohttp://localhost:4318
.headers
: List of additional headers to add to export requests.protocol
: The transport protocol to use, supported values:grpc
andhttp_protobuf
. Defaults tohttp_protobuf
.compression
: Compression to use, supported value:gzip
. Defaults to no compression.ssl_options
: a list of SSL options. See Erlang's SSL docs for what options are available.
Endpoints configuration
You can pass your collector endpoints in three forms:
- As a string, i.e
"https://localhost:4000"
. - As a map, with the following keys:
host => unicode:chardata()
path => unicode:chardata()
port => integer() >= 0 | undefined
scheme => unicode:chardata()
- As a 4 element tuple in format
{Scheme, Host, Port, SSLOptions}
.
http_protobuf
protocol, currently only the first endpoint in that list is used to export traces, the rest is effectively ignored. grpc
supports multiple endpoints.
Summary
Functions
Export OTLP protocol telemery data to the configured endpoints.
Initialize the exporter based on the provided configuration.
Shutdown the exporter.