telemetry

package
v1.30.3 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: GPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// TracerName is the name of the tracer
	TracerName = "github.com/dagu-org/dagu"
)

Variables

This section is empty.

Functions

func ExtractTraceContext

func ExtractTraceContext(ctx context.Context) context.Context

ExtractTraceContext extracts trace context from environment variables

func InitializePropagators

func InitializePropagators()

InitializePropagators sets up W3C trace context propagator as the global propagator

func InjectTraceContext

func InjectTraceContext(ctx context.Context) []string

InjectTraceContext injects the trace context from the current span into environment variables

func NewRegistry

func NewRegistry(collector *Collector) *prometheus.Registry

NewRegistry creates a new Prometheus registry with Dagu collectors

Types

type Collector

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

Collector implements prometheus.Collector interface

func NewCollector

func NewCollector(
	version string,
	dagStore execution.DAGStore,
	dagRunStore execution.DAGRunStore,
	queueStore execution.QueueStore,
	serviceRegistry execution.ServiceRegistry,
) *Collector

NewCollector creates a new metrics collector

func (*Collector) Collect

func (c *Collector) Collect(ch chan<- prometheus.Metric)

Collect implements prometheus.Collector

func (*Collector) Describe

func (c *Collector) Describe(ch chan<- *prometheus.Desc)

Describe implements prometheus.Collector

func (*Collector) RegisterCache added in v1.30.0

func (c *Collector) RegisterCache(cache fileutil.CacheMetrics)

RegisterCache adds a cache to be monitored for metrics

type TraceContextCarrier

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

TraceContextCarrier is a carrier for W3C trace context propagation via environment variables

func NewTraceContextCarrier

func NewTraceContextCarrier() *TraceContextCarrier

NewTraceContextCarrier creates a new carrier for trace context propagation

func (*TraceContextCarrier) Get

func (c *TraceContextCarrier) Get(key string) string

Get returns the value associated with the passed key

func (*TraceContextCarrier) Keys

func (c *TraceContextCarrier) Keys() []string

Keys lists the keys stored in this carrier

func (*TraceContextCarrier) Set

func (c *TraceContextCarrier) Set(key string, value string)

Set stores the key-value pair

func (*TraceContextCarrier) ToEnv

func (c *TraceContextCarrier) ToEnv() []string

ToEnv converts the carrier to environment variables format

type Tracer

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

Tracer wraps OpenTelemetry tracer with DAG-specific configuration

func NewTracer

func NewTracer(ctx context.Context, dag *core.DAG) (*Tracer, error)

NewTracer creates a new OpenTelemetry tracer for a DAG

func (*Tracer) IsEnabled

func (t *Tracer) IsEnabled() bool

IsEnabled returns true if OTel is enabled

func (*Tracer) Shutdown

func (t *Tracer) Shutdown(ctx context.Context) error

Shutdown shuts down the tracer provider

func (*Tracer) Start

func (t *Tracer) Start(ctx context.Context, spanName string, opts ...trace.SpanStartOption) (context.Context, trace.Span)

Start starts a new span for the DAG execution

Jump to

Keyboard shortcuts

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