tracing

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package tracing provides OpenTelemetry trace integration for GRIP.

This package creates spans for gRPC handler execution and records events for admission, retry, and failure classification.

Example:

tracer := tracing.New(tracing.Config{
    TracerProvider: otel.GetTracerProvider(),
    ServiceName:    "my-service",
})

Package tracing provides OpenTelemetry trace integration for GRIP execution pipelines.

The tracer creates spans for each execution, recording RPC type, admission decisions, supervisor lifecycle events, and error classification.

Usage:

tracer := tracing.New()                          // uses global TracerProvider
tracer := tracing.New(tracing.WithTracerProvider(tp)) // custom provider

Integration with GRIP pipelines:

u := unary.New(unary.WithTracer(tracer))

Manual span management:

ctx, span := tracer.StartSpan(ctx, "my.operation",
    tracing.RPCType("unary"),
)
defer tracer.EndSpan(span, err)

Index

Constants

This section is empty.

Variables

View Source
var (
	// RPCType returns an attribute for the RPC type.
	RPCType = it.RPCType

	// AdmissionResult returns an attribute for the admission result.
	AdmissionResult = it.AdmissionResult

	// RetryAttempt returns an attribute for the retry attempt number.
	RetryAttempt = it.RetryAttempt

	// FailureKind returns an attribute for the failure kind.
	FailureKind = it.FailureKind
)

Attribute helpers for GRIP spans.

View Source
var (
	AttrRPCType      = attribute.Key("grip.rpc.type")
	AttrAdmission    = attribute.Key("grip.admission.result")
	AttrRetryAttempt = attribute.Key("grip.retry.attempt")
	AttrFailureKind  = attribute.Key("grip.failure.kind")
)

Common attribute keys for GRIP spans.

View Source
var NoopTracer = it.NoopTracer

NoopTracer returns a tracer that does nothing.

Functions

This section is empty.

Types

type Option

type Option = it.Option

Option configures the tracer.

func WithTracerProvider

func WithTracerProvider(tp trace.TracerProvider) Option

WithTracerProvider sets a custom TracerProvider.

type Tracer

type Tracer = it.Tracer

Tracer wraps OpenTelemetry tracing for GRIP execution pipelines.

func New

func New(opts ...Option) *Tracer

New creates a new GRIP tracer.

tracer := tracing.New()                                   // global provider
tracer := tracing.New(tracing.WithTracerProvider(tp))     // custom provider

Jump to

Keyboard shortcuts

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