README.md (3323B)
1 # OpenTelemetry-Go OTLP Span Exporter 2 3 [![Go Reference](https://pkg.go.dev/badge/go.opentelemetry.io/otel/exporters/otlp/otlptrace.svg)](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace) 4 5 [OpenTelemetry Protocol Exporter](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md) implementation. 6 7 ## Installation 8 9 ``` 10 go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace 11 ``` 12 13 ## Examples 14 15 - [HTTP Exporter setup and examples](./otlptracehttp/example_test.go) 16 - [Full example of gRPC Exporter sending telemetry to a local collector](../../../example/otel-collector) 17 18 ## [`otlptrace`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace) 19 20 The `otlptrace` package provides an exporter implementing the OTel span exporter interface. 21 This exporter is configured using a client satisfying the `otlptrace.Client` interface. 22 This client handles the transformation of data into wire format and the transmission of that data to the collector. 23 24 ## [`otlptracegrpc`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc) 25 26 The `otlptracegrpc` package implements a client for the span exporter that sends trace telemetry data to the collector using gRPC with protobuf-encoded payloads. 27 28 ## [`otlptracehttp`](https://pkg.go.dev/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp) 29 30 The `otlptracehttp` package implements a client for the span exporter that sends trace telemetry data to the collector using HTTP with protobuf-encoded payloads. 31 32 ## Configuration 33 34 ### Environment Variables 35 36 The following environment variables can be used (instead of options objects) to 37 override the default configuration. For more information about how each of 38 these environment variables is interpreted, see [the OpenTelemetry 39 specification](https://github.com/open-telemetry/opentelemetry-specification/blob/v1.20.0/specification/protocol/exporter.md). 40 41 | Environment variable | Option | Default value | 42 | ------------------------------------------------------------------------ |------------------------------ | -------------------------------------------------------- | 43 | `OTEL_EXPORTER_OTLP_ENDPOINT` `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` | `WithEndpoint` `WithInsecure` | `https://localhost:4317` or `https://localhost:4318`[^1] | 44 | `OTEL_EXPORTER_OTLP_CERTIFICATE` `OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE` | `WithTLSClientConfig` | | 45 | `OTEL_EXPORTER_OTLP_HEADERS` `OTEL_EXPORTER_OTLP_TRACES_HEADERS` | `WithHeaders` | | 46 | `OTEL_EXPORTER_OTLP_COMPRESSION` `OTEL_EXPORTER_OTLP_TRACES_COMPRESSION` | `WithCompression` | | 47 | `OTEL_EXPORTER_OTLP_TIMEOUT` `OTEL_EXPORTER_OTLP_TRACES_TIMEOUT` | `WithTimeout` | `10s` | 48 49 [^1]: The gRPC client defaults to `https://localhost:4317` and the HTTP client `https://localhost:4318`. 50 51 Configuration using options have precedence over the environment variables.