f1971b3f81
* POC using the grpc.ClientConn to handle connections * Update invalid client security test * Update client start test for a bad endpoint * Use any ClientConn a user provides * Connect ReconnectionPeriod to gRPC conn retries * Replace connection retry handling direct in otlptracegrpc * Fix client comments * Fix comment for NewGRPCConfig * Replace reconnection test * Fix grammar * Remove unrelated changes * Remove connection pkg * Rename evaluate to retryable * POC using the grpc.ClientConn to handle connections * Replace connection retry handling direct in otlptracegrpc * Add ClientConn use changes to changelog * Update otlptracegrpc options * Only close ClientConn that the Client create * Remove listener wrapper from mock_collector_test This is not needed now that no tests relies on the listener to wait for a connection to be established before continuing. * Fix spelling error * Do not use deprecated options in the otel-collector example * Add unit tests for retryable and throttleDelay funcs * Add unit tests for context heredity * Add test that exporter stop is linked to context cancel * go mod tidy * Update exporters/otlp/otlptrace/otlptracegrpc/client.go Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> * Fix go.mod from rebase * Remove wrong comment about client stop closing gRPC conn * Fix shutdown test cleanup Do not check the second call to the client Stop. There is no guarantee it will not error in normal operation. * Make lint fixes * Fix flaky unit test Use the internals of the client to explicit cancel the context returned from exportContext. This gets around the bug where the select in Stop may randomly choose the non-context Done case and avoid returning an error (also failing to cancel the context). * Remove deprecation To configure the client/exporter with environment variables these options are used. There is no way to fully remove these options without removing support for configuration with environment variables. Leave that decision and strategy determination to a separate PR. * Fix grammatical error in comment Co-authored-by: Anthony Mirabella <a9@aneurysm9.com> |
||
---|---|---|
.. | ||
internal | ||
otlptracegrpc | ||
otlptracehttp | ||
clients.go | ||
exporter.go | ||
go.mod | ||
go.sum | ||
README.md |
OpenTelemetry-Go OTLP Span Exporter
OpenTelemetry Protocol Exporter implementation.
Installation
go get -u go.opentelemetry.io/otel/exporters/otlp/otlptrace
Examples
otlptrace
The otlptrace
package provides an exporter implementing the OTel span exporter interface.
This exporter is configured using a client satisfying the otlptrace.Client
interface.
This client handles the transformation of data into wire format and the transmission of that data to the collector.
otlptracegrpc
The otlptracegrpc
package implements a client for the span exporter that sends trace telemetry data to the collector using gRPC with protobuf-encoded payloads.
otlptracehttp
The otlptracehttp
package implements a client for the span exporter that sends trace telemetry data to the collector using HTTP with protobuf-encoded payloads.
Configuration
Environment Variables
The following environment variables can be used (instead of options objects) to override the default configuration.
Environment variable | Option | Default value |
---|---|---|
OTEL_EXPORTER_OTLP_ENDPOINT OTEL_EXPORTER_OTLP_TRACES_ENDPOINT |
WithEndpoint WithInsecure |
https://localhost:4317 |
OTEL_EXPORTER_OTLP_CERTIFICATE OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE |
WithTLSClientConfig |
|
OTEL_EXPORTER_OTLP_HEADERS OTEL_EXPORTER_OTLP_TRACES_HEADERS |
WithHeaders |
|
OTEL_EXPORTER_OTLP_COMPRESSION OTEL_EXPORTER_OTLP_TRACES_COMPRESSION |
WithCompression |
|
OTEL_EXPORTER_OTLP_TIMEOUT OTEL_EXPORTER_OTLP_TRACES_TIMEOUT |
WithTimeout |
10s |
Configuration using options have precedence over the environment variables.