Documentation
¶
Overview ¶
Package tracing creates OpenTelemetry span exporters from environment variables.
NewSpanExporters reads OTEL_TRACES_EXPORTER and returns the corresponding exporters. Supported values:
- "otlp": OTLP exporter (protocol selected by OTEL_EXPORTER_OTLP_PROTOCOL, defaults to "http/protobuf"; also supports "grpc")
- "stdout": Pretty-printed traces on standard output
- "file": JSON traces written to OTEL_EXPORTER_FILE_PATH (defaults to traces.json)
- "none": Disables trace export
Multiple exporters can be enabled by separating values with commas.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSpanExporters ¶
func NewSpanExporters(ctx context.Context) ([]trace.SpanExporter, error)
NewSpanExporters returns a list of trace.SpanExporter based on the OTEL_* environment variables which are standardized. Unfortunately, they are not yet supported by opentelemetry-go by default. Once they are, we can likely remove most of this code.
Specs: - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/configuration/sdk-environment-variables.md#exporter-selection - https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md
Types ¶
This section is empty.