opentelemetry

package module
Version: v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2021 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

Package opentelemetry provides OpenTelemetry utilities.

Index

Constants

This section is empty.

Variables

DefaultTextMapPropagator is the default OpenTelemetry TextMapPropagator used by this implementation if not otherwise set in TracerOptions.

Functions

func NewTracer

func NewTracer(options TracerOptions) (interceptor.Tracer, error)

NewTracer creates a tracer with the given options. Most callers should use NewTracingInterceptor instead.

func NewTracingInterceptor

func NewTracingInterceptor(options TracerOptions) (interceptor.Interceptor, error)

NewTracingInterceptor creates an interceptor for setting on client options that implements OpenTelemetry tracing for workflows.

Types

type TracerOptions

type TracerOptions struct {
	// Tracer is the tracer to use. If not set, one is obtained from the global
	// tracer provider using the name "temporal-sdk-go".
	Tracer trace.Tracer

	// TextMapPropagator is the propagator to use for serializing spans. If not
	// set, this uses DefaultTextMapPropagator, not the OpenTelemetry global one.
	// To use the OpenTelemetry global one, set this value to the result of the
	// global call.
	TextMapPropagator propagation.TextMapPropagator

	// SpanContextKey is the context key used for internal span tracking (not to
	// be confused with the context key OpenTelemetry uses internally). If not
	// set, this defaults to an internal key (recommended).
	SpanContextKey interface{}

	// HeaderKey is the Temporal header field key used to serialize spans. If
	// empty, this defaults to the one used by all SDKs (recommended).
	HeaderKey string

	// SpanStarter is a callback to create spans. If not set, this creates normal
	// OpenTelemetry spans calling Tracer.Start.
	SpanStarter func(ctx context.Context, t trace.Tracer, spanName string, opts ...trace.SpanStartOption) trace.Span
}

TracerOptions are options provided to NewTracingInterceptor or NewTracer.

Jump to

Keyboard shortcuts

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