opentelemetry_exporter (opentelemetry_exporter v1.0.0-rc.4) View Source

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 enevironment options are:

  • otlp_endpoint: The URL to send traces and metrics 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.

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.

Link to this section Summary

Functions

Export OTLP protocol telemery data to the configured endpoints.
Initialize the exporter based on the provided configuration.
Shutdown the exporter.

Link to this section Types

Specs

compression() :: gzip.

Specs

Specs

endpoint_map() ::
    #{scheme := scheme(),
      host := host(),
      path => unicode:chardata(),
      port => integer(),
      ssl_options => []}.

Specs

headers() :: [{unicode:chardata(), unicode:chardata()}].

Specs

host() :: unicode:chardata().

Specs

opts() :: #{endpoints => [endpoint()], headers => headers(), protocol => protocol()}.

Specs

protocol() :: grpc | http_protobuf | http_json.

Specs

scheme() :: http | https | string() | binary().

Link to this section Functions

Link to this function

export(Tab, Resource, State)

View Source
Export OTLP protocol telemery data to the configured endpoints.

Specs

init(opts()) -> {ok, #state{}}.
Initialize the exporter based on the provided configuration.
Shutdown the exporter.