telemetry

package
v0.0.0-...-f087424 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2026 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BunQueryHook

type BunQueryHook struct {
	// contains filtered or unexported fields
}

func NewBunQueryHook

func NewBunQueryHook(runtime *Runtime, metrics *Registry) *BunQueryHook

func (*BunQueryHook) AfterQuery

func (h *BunQueryHook) AfterQuery(ctx context.Context, event *bun.QueryEvent)

func (*BunQueryHook) BeforeQuery

func (h *BunQueryHook) BeforeQuery(ctx context.Context, event *bun.QueryEvent) context.Context

type Config

type Config struct {
	Enabled          bool
	ServiceName      string
	OTLPEndpoint     string
	Insecure         bool
	TraceSampleRatio float64
}

Config controls optional OpenTelemetry tracing. Metrics remain available through Registry even when tracing is disabled.

type RedisHook

type RedisHook struct {
	// contains filtered or unexported fields
}

func NewRedisHook

func NewRedisHook(runtime *Runtime, metrics *Registry) *RedisHook

func (*RedisHook) DialHook

func (h *RedisHook) DialHook(next redis.DialHook) redis.DialHook

func (*RedisHook) ProcessHook

func (h *RedisHook) ProcessHook(next redis.ProcessHook) redis.ProcessHook

func (*RedisHook) ProcessPipelineHook

func (h *RedisHook) ProcessPipelineHook(next redis.ProcessPipelineHook) redis.ProcessPipelineHook

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry is a small Prometheus text-format registry. It deliberately keeps labels bounded to prevent request data from becoming metric cardinality.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) Add

func (r *Registry) Add(name string, labels map[string]string, value float64)

func (*Registry) Handler

func (r *Registry) Handler() http.Handler

func (*Registry) Inc

func (r *Registry) Inc(name string, labels map[string]string)

func (*Registry) Observe

func (r *Registry) Observe(name string, labels map[string]string, value float64)

Observe exports a Prometheus-compatible summary pair without retaining raw observations in memory.

type Runtime

type Runtime struct {
	// contains filtered or unexported fields
}

Runtime owns the provider created for one Mesa instance. It does not change global OpenTelemetry providers, which keeps multiple Mesa instances safe in tests and in embedding applications.

func New

func New(ctx context.Context, cfg Config) (*Runtime, error)

func (*Runtime) Propagator

func (r *Runtime) Propagator() propagation.TextMapPropagator

func (*Runtime) Shutdown

func (r *Runtime) Shutdown(ctx context.Context) error

func (*Runtime) Start

func (r *Runtime) Start(ctx context.Context, name string, attrs ...attribute.KeyValue) (context.Context, trace.Span)

func (*Runtime) Tracer

func (r *Runtime) Tracer(name string) trace.Tracer

func (*Runtime) TracerProvider

func (r *Runtime) TracerProvider() trace.TracerProvider

Jump to

Keyboard shortcuts

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