mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2025-01-05 22:54:18 +02:00
d75e268053
* sdk/trace: add missing options to tracer provider This change adds `WithDefaultSampler` and `WithSpanLimits` to the tracer provider and removed `WithConfig` from it. Before this change, `WithConfig` is the only way to set sampler or limits of a span. However, it is prone to misuse, since `WithConfig` can override tracing configurations that are configured by `WithResource` or `WithIDGenerator`. Thus to fix this, it adds new functional options - `WithDefaultSampler` and `WithSpanLimits` and removes `WithConfig`. Resolves #1631. * Update sdk/trace/provider.go Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> * Update sdk/trace/provider.go Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> * rebase and remove WithConfig Co-authored-by: Tyler Yahn <MrAlias@users.noreply.github.com> |
||
---|---|---|
.. | ||
internal | ||
otlpgrpc | ||
otlphttp | ||
doc.go | ||
example_test.go | ||
go.mod | ||
go.sum | ||
options.go | ||
otlp_metric_test.go | ||
otlp_span_test.go | ||
otlp_test.go | ||
otlp.go | ||
protocoldriver.go | ||
README.md |
OpenTelemetry Collector Go Exporter
This exporter exports OpenTelemetry spans and metrics to the OpenTelemetry Collector.
Installation and Setup
The exporter can be installed using standard go
functionality.
$ go get -u go.opentelemetry.io/otel/exporters/otlp
A new exporter can be created using the NewExporter
function.
Retries
The exporter will not, by default, retry failed requests to the collector. However, it is configured in a way that it can be easily enabled.
To enable retries, the GRPC_GO_RETRY
environment variable needs to be set to on
. For example,
GRPC_GO_RETRY=on go run .
The default service config used by default is defined to retry failed requests with exponential backoff (0.3seconds * (2)^retry
) with a max of 5
retries).
These retries are only attempted for reponses that are deemed "retry-able" by the collector.