View Source otel_exporter_traces_otlp (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, metrics and logs to, for traces the path v1/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 and http_protobuf. Defaults to http_protobuf.
  • otlp_traces_protocol: The transport protocol to use for exporting traces, supported values: grpc and http_protobuf. Defaults to http_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 path v1/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 and http_protobuf. Defaults to http_protobuf.
  • OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: The transport protocol to use for exporting traces, supported values: grpc and http_protobuf. Defaults to http_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.
You can also set these configuration values in the map passed to the opentelemetry processor configuration.
  • endpoints: A list of endpoints to send traces to. Can take one of the forms described below. By default, exporter sends data to http://localhost:4318.
  • headers: List of additional headers to add to export requests.
  • protocol: The transport protocol to use, supported values: grpc and http_protobuf. Defaults to http_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}.
While using 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.

Functions

Link to this function

export(Tab, Resource, State)

View Source
Export OTLP protocol telemery data to the configured endpoints.
-spec init(otel_exporter_otlp:opts()) ->
        {ok,
         #state{channel :: term(),
                httpc_profile :: atom() | undefined,
                protocol :: otel_exporter_otlp:protocol(),
                channel_pid :: pid() | undefined,
                headers :: otel_exporter_otlp:headers(),
                compression :: otel_exporter_otlp:compression() | undefined,
                grpc_metadata :: map() | undefined,
                endpoints :: [otel_exporter_otlp:endpoint_map()]}}.
Initialize the exporter based on the provided configuration.
Link to this function

merge_with_environment(Opts)

View Source
Shutdown the exporter.