Documentation ¶
Index ¶
Constants ¶
const ( DDOperationNameKey = attribute.Key("operation.name") DDResourceNameKey = attribute.Key("resource.name") )
Variables ¶
This section is empty.
Functions ¶
func NewTracer ¶
NewTracer creates a trace.Tracer which sets the attributes "operation.name" and "resource.name", so that DataDog span names are formatted correctly.
func NewTracerProvider ¶
func NewTracerProvider(operationName string, opts ...Option) trace.TracerProvider
NewTracerProvider creates a trace.TracerProvider that returns a trace.Tracer which sets the attributes "operation.name" and "resource.name", so that DataDog span names are formatted correctly.
Types ¶
type OperationNameFormatter ¶
type Option ¶
type Option func(*tracerProvider)
func WithOperationNameFormatter ¶
func WithOperationNameFormatter(operationNameFormatter OperationNameFormatter) Option
WithOperationNameFormatter sets a function to customize the operation name.
func WithSpanNameFormatter ¶
func WithSpanNameFormatter(spanNameFormatter SpanNameFormatter) Option
WithSpanNameFormatter sets a function to customize the span name.
func WithTracerProvider ¶
func WithTracerProvider(base trace.TracerProvider) Option
WithTracerProvider sets a base trace.TracerProvider. If not set, the global trace provider will be used.
type SpanNameFormatter ¶
type TracerOption ¶
type TracerOption func(*tracer)
func WithTracerOperationNameFormatter ¶
func WithTracerOperationNameFormatter(operationNameFormatter OperationNameFormatter) TracerOption
WithTracerOperationNameFormatter sets a function to customize the operation name.
func WithTracerSpanNameFormatter ¶
func WithTracerSpanNameFormatter(spanNameFormatter SpanNameFormatter) TracerOption
WithTracerSpanNameFormatter sets a function to customize the span name.