tracing

package
v0.43.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2026 License: Apache-2.0, MIT Imports: 9 Imported by: 9 modules, 9 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL