Documentation
¶
Index ¶
- func RecordDBPoolRejection(ctx context.Context)
- func RecordDBPoolStats(ctx context.Context, snapshot DBPoolSnapshot)
- func RecordJobConcurrencySnapshot(ctx context.Context, jobID string, runningTasks int64, concurrencyLimit int64, ...)
- func RecordJobInfoCacheHit(ctx context.Context, jobID string)
- func RecordJobInfoCacheInvalidation(ctx context.Context, jobID, reason string)
- func RecordJobInfoCacheMiss(ctx context.Context, jobID string)
- func RecordJobInfoCacheSize(ctx context.Context, size int)
- func RecordTaskClaimAttempt(ctx context.Context, jobID string, latency time.Duration, status string)
- func RecordTaskWaiting(ctx context.Context, jobID string, reason string, count int)
- func RecordWorkerConcurrency(ctx context.Context, workerID int, delta int64, capacity int64)
- func RecordWorkerTask(ctx context.Context, metrics WorkerTaskMetrics)
- func RecordWorkerTaskFailure(ctx context.Context, jobID string, reason string)
- func RecordWorkerTaskRetry(ctx context.Context, jobID string, reason string)
- func StartWorkerTaskSpan(ctx context.Context, info WorkerTaskSpanInfo) (context.Context, trace.Span)
- func WrapHandler(handler http.Handler, prov *Providers) http.Handler
- type Config
- type DBPoolSnapshot
- type Providers
- type WorkerTaskMetrics
- type WorkerTaskSpanInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecordDBPoolRejection ¶
RecordDBPoolRejection increments the pool rejection counter when requests are rejected before acquiring a connection.
func RecordDBPoolStats ¶
func RecordDBPoolStats(ctx context.Context, snapshot DBPoolSnapshot)
RecordDBPoolStats records database pool utilisation metrics.
func RecordJobConcurrencySnapshot ¶
func RecordJobConcurrencySnapshot(ctx context.Context, jobID string, runningTasks int64, concurrencyLimit int64, unlimited bool)
RecordJobConcurrencySnapshot captures the running task count and concurrency limit for a job.
func RecordJobInfoCacheHit ¶
func RecordJobInfoCacheMiss ¶
func RecordJobInfoCacheSize ¶
func RecordTaskClaimAttempt ¶
func RecordTaskClaimAttempt(ctx context.Context, jobID string, latency time.Duration, status string)
RecordTaskClaimAttempt records the latency of claiming a task from the queue.
func RecordTaskWaiting ¶
RecordTaskWaiting records when tasks move into the waiting queue along with the reason.
func RecordWorkerConcurrency ¶
RecordWorkerConcurrency records the change in concurrent tasks for a worker. delta: +1 when starting a task, -1 when completing capacity: the worker's concurrency limit (only recorded once per worker on startup)
func RecordWorkerTask ¶
func RecordWorkerTask(ctx context.Context, metrics WorkerTaskMetrics)
RecordWorkerTask emits worker task metrics when instrumentation is initialised.
func RecordWorkerTaskFailure ¶
RecordWorkerTaskFailure records a permanently failed task.
func RecordWorkerTaskRetry ¶
RecordWorkerTaskRetry records a retry attempt for a task.
func StartWorkerTaskSpan ¶
func StartWorkerTaskSpan(ctx context.Context, info WorkerTaskSpanInfo) (context.Context, trace.Span)
StartWorkerTaskSpan starts a span for an individual worker task.
Types ¶
type Config ¶
type Config struct {
Enabled bool
ServiceName string
Environment string
OTLPEndpoint string
OTLPHeaders map[string]string
OTLPInsecure bool
MetricsAddress string
}
Config controls observability initialisation.
type DBPoolSnapshot ¶
type DBPoolSnapshot struct {
InUse int
Idle int
WaitCount int64
WaitDuration time.Duration
MaxOpen int
Reserved int
Usage float64
}
DBPoolSnapshot describes a database connection pool state.
type Providers ¶
type Providers struct {
TracerProvider *sdktrace.TracerProvider
MeterProvider *sdkmetric.MeterProvider
Propagator propagation.TextMapPropagator
MetricsHandler http.Handler
Shutdown func(ctx context.Context) error
Config Config
}
Providers exposes configured telemetry providers.