Documentation
¶
Overview ¶
Package tracing creates OpenTelemetry spans for job work and inserts: "foreman.work <kind>" with job id, kind, queue and attempt attributes.
tr := tracing.New(tp) ctx, span := tr.StartWork(ctx, job.ID, job.Kind, job.Queue, job.Attempt) defer tracing.End(span, err)
Index ¶
Constants ¶
View Source
const ( AttrJobID = attribute.Key("foreman.job.id") AttrKind = attribute.Key("foreman.job.kind") AttrQueue = attribute.Key("foreman.queue") AttrAttempt = attribute.Key("foreman.job.attempt") AttrCount = attribute.Key("foreman.job.count") )
Span attribute keys.
View Source
const InstrumentationName = "github.com/thnhdatle/foreman"
InstrumentationName identifies Foreman's tracer.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Tracer ¶
type Tracer struct {
// contains filtered or unexported fields
}
Tracer creates Foreman spans; a nil provider disables tracing.
func New ¶
func New(tp trace.TracerProvider) *Tracer
New returns a tracer from tp (no-op when tp is nil).
func (*Tracer) StartInsert ¶
StartInsert starts the span "foreman.insert <kind>" around an insert of n jobs.
Click to show internal directories.
Click to hide internal directories.