Documentation
¶
Index ¶
- Variables
- func EnablePrometheusMetrics() error
- func InjectHeaders(ctx context.Context, carrier http.Header)
- func InjectMap(ctx context.Context, carrier map[string]string)
- func SpanFromContext(ctx context.Context) trace.Span
- type Configuration
- type Span
- func (s *Span) AddEvent(name string, options ...trace.EventOption)
- func (s *Span) End(options ...trace.SpanEndOption)
- func (s *Span) Finish()
- func (s *Span) IsRecording() bool
- func (s *Span) RecordError(err error, options ...trace.EventOption)
- func (s *Span) SetAttributes(kv ...attribute.KeyValue)
- func (s *Span) SetName(name string)
- func (s *Span) SetStatus(code codes.Code, description string)
- func (s *Span) SetTag(key string, value interface{}) *Span
- func (s *Span) SpanContext() trace.SpanContext
- func (s *Span) TracerProvider() trace.TracerProvider
- type SpanBuilder
- func (b SpanBuilder) ExtractHeaders(carrier http.Header) SpanBuilder
- func (b SpanBuilder) ExtractMap(carrier map[string]string) SpanBuilder
- func (b SpanBuilder) Start(ctx context.Context) *Span
- func (b SpanBuilder) StartWithContext(ctx context.Context) (context.Context, *Span)
- func (b SpanBuilder) WithName(name string) SpanBuilder
- type Tracer
Constants ¶
This section is empty.
Variables ¶
var ErrInvalidConfiguration = errors.New("invalid configuration")
Functions ¶
func EnablePrometheusMetrics ¶ added in v0.13.0
func EnablePrometheusMetrics() error
Types ¶
type Configuration ¶ added in v0.15.0
type Configuration struct {
ServiceName string
Addr string
Disabled bool
Sampler tracesdk.Sampler
Attributes []attribute.KeyValue
SpanProcessorOptions []tracesdk.BatchSpanProcessorOption
}
func DefaultConfiguration ¶
func DefaultConfiguration(service, addr string) *Configuration
type Span ¶
type Span struct {
// contains filtered or unexported fields
}
func (*Span) AddEvent ¶ added in v0.15.0
func (s *Span) AddEvent(name string, options ...trace.EventOption)
AddEvent adds an event with the provided name and options.
func (*Span) End ¶ added in v0.15.0
func (s *Span) End(options ...trace.SpanEndOption)
End completes the Span. The Span is considered complete and ready to be delivered through the rest of the telemetry pipeline after this method is called. Therefore, updates to the Span are not allowed after this method has been called.
func (*Span) IsRecording ¶ added in v0.15.0
IsRecording returns the recording state of the Span. It will return true if the Span is active and events can be recorded.
func (*Span) RecordError ¶ added in v0.15.0
func (s *Span) RecordError(err error, options ...trace.EventOption)
RecordError will record err as an exception span event for this span. An additional call to SetStatus is required if the Status of the Span should be set to Error, as this method does not change the Span status. If this span is not being recorded or err is nil then this method does nothing.
func (*Span) SetAttributes ¶ added in v0.15.0
SetAttributes sets kv as attributes of the Span. If a key from kv already exists for an attribute of the Span it will be overwritten with the value contained in kv.
func (*Span) SetStatus ¶ added in v0.15.0
SetStatus sets the status of the Span in the form of a code and a description, overriding previous values set. The description is only included in a status when the code is for an error.
func (*Span) SpanContext ¶ added in v0.15.0
func (s *Span) SpanContext() trace.SpanContext
SpanContext returns the SpanContext of the Span. The returned SpanContext is usable even after the End method has been called for the Span.
func (*Span) TracerProvider ¶ added in v0.15.0
func (s *Span) TracerProvider() trace.TracerProvider
TracerProvider returns a TracerProvider that can be used to generate additional Spans on the same telemetry pipeline as the current Span.
type SpanBuilder ¶
type SpanBuilder struct {
// contains filtered or unexported fields
}
func (SpanBuilder) ExtractHeaders ¶
func (b SpanBuilder) ExtractHeaders(carrier http.Header) SpanBuilder
func (SpanBuilder) ExtractMap ¶
func (b SpanBuilder) ExtractMap(carrier map[string]string) SpanBuilder
func (SpanBuilder) StartWithContext ¶ added in v0.15.0
func (SpanBuilder) WithName ¶
func (b SpanBuilder) WithName(name string) SpanBuilder