Documentation
¶
Overview ¶
Package otel provides customization for OpenTelemetry.
Index ¶
- func Runners(opts ...Option) []func(context.Context) error
- func TraceSample(ctx context.Context) bool
- type Option
- func WithMetric(opts ...controller.Option) Option
- func WithMetricDistribution(distribution export.AggregatorSelector) Option
- func WithMetricExporter(exporter func(context.Context) (export.Exporter, func(), error)) Option
- func WithOTLPMetricExporter(opts ...otlpmetricgrpc.Option) Option
- func WithOTLPTraceExporter(opts ...otlptracegrpc.Option) Option
- func WithResource(opts ...resource.Option) Option
- func WithRuntimeMetric(opts ...runtime.Option) Option
- func WithService(name string) Option
- func WithTrace(opts ...sdk.TracerProviderOption) Option
- func WithTraceExporter(exporter func(context.Context) (sdk.SpanExporter, error), ...) Option
- func WithVersion(version string) Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TraceSample ¶
TraceSample returns a Sampler that samples log according to trace sampling.
Types ¶
type Option ¶
type Option func(*options)
Option configures OpenTelemetry.
func WithMetric ¶
func WithMetric(opts ...controller.Option) Option
WithMetric enables OpenTelemetry metric collection.
See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md.
This is an EXPERIMENTAL API and may be changed or removed in the future.
func WithMetricDistribution ¶
func WithMetricDistribution(distribution export.AggregatorSelector) Option
WithMetricDistribution configures the distribution aggregator of OpenTelemetry metric collection.
This is an EXPERIMENTAL API and may be changed or removed in the future.
func WithMetricExporter ¶
WithMetricExporter enables OpenTelemetry metric collection with provided metric exporter.
This is an EXPERIMENTAL API and may be changed or removed in the future.
func WithOTLPMetricExporter ¶ added in v0.4.0
func WithOTLPMetricExporter(opts ...otlpmetricgrpc.Option) Option
WithOTLPMetricExporter starts OpenTelemetry meter with OpenTelemetry Collector.
func WithOTLPTraceExporter ¶ added in v0.4.0
func WithOTLPTraceExporter(opts ...otlptracegrpc.Option) Option
WithOTLPTraceExporter starts OpenTelemetry trace with OpenTelemetry Collector.
func WithResource ¶
WithResource configures telemetry Resource.
func WithRuntimeMetric ¶
WithRuntimeMetric enables collection of runtime metrics.
See https://opentelemetry.io/registry/instrumentation-go-runtime/.
func WithService ¶
WithService provides service name to use instead of the one parse from build info or executable name.
func WithTrace ¶
func WithTrace(opts ...sdk.TracerProviderOption) Option
WithTrace enables OpenTelemetry trace collection.
See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md.
func WithTraceExporter ¶
func WithTraceExporter( exporter func(context.Context) (sdk.SpanExporter, error), batchOpts ...sdk.BatchSpanProcessorOption, ) Option
WithTraceExporter enables OpenTelemetry trace collection with provided trace exporter.
func WithVersion ¶ added in v0.3.0
WithVersion provides service version to use instead of the one parse from build info.