Documentation
¶
Index ¶
- func ParseOTLPHeaders(raw string) map[string]string
- func RecordBrokerAutoclaim(ctx context.Context, jobID, result string, count int)
- func RecordBrokerCounterPELSkew(ctx context.Context, jobID string, skew float64)
- func RecordBrokerCounterSyncSkew(ctx context.Context, jobID string, skew float64)
- func RecordBrokerDispatch(ctx context.Context, jobID, outcome string)
- func RecordBrokerMessageAge(ctx context.Context, jobID string, ageMs float64)
- func RecordBrokerOutbox(ctx context.Context, backlog int64, oldestAgeSeconds float64)
- func RecordBrokerOutboxSweep(ctx context.Context, outcome string, count int)
- func RecordBrokerPELWithoutConsumer(ctx context.Context, count int64)
- func RecordBrokerPacerDelay(ctx context.Context, domain string, delayMs float64)
- func RecordBrokerPacerPushback(ctx context.Context, domain, reason string)
- func RecordBrokerRedisPing(ctx context.Context, duration time.Duration, ok bool)
- func RecordBrokerRedisPool(ctx context.Context, snap RedisPoolSnapshot)
- func RecordBrokerStreamStats(ctx context.Context, s BrokerStreamStats)
- func RecordCrawlerPhase(ctx context.Context, metrics CrawlerPhaseMetrics)
- func RecordDBPoolRejection(ctx context.Context)
- func RecordDBPoolStats(ctx context.Context, snapshot DBPoolSnapshot)
- func RecordDBPressureAdjustment(ctx context.Context, direction string)
- func RecordDBPressureStats(ctx context.Context, emaMs float64, limit int32)
- func RecordFDStats(ctx context.Context, current, limit int, pressure float64)
- func RecordHTMLPersistBodyBytes(ctx context.Context, bytes int64)
- func RecordHTMLPersistQueueDepth(ctx context.Context, depth int)
- func RecordHTMLPersistUpload(ctx context.Context, outcome string)
- func RecordHTMLPersistUploadDuration(ctx context.Context, duration time.Duration)
- 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 RecordLighthouseRun(ctx context.Context, jobID, outcome string)
- func RecordLighthouseRunDuration(ctx context.Context, jobID, outcome string, durationMs float64)
- func RecordLighthouseRunRetry(ctx context.Context, jobID, reason string)
- func RecordLighthouseScheduled(ctx context.Context, jobID, band string, count int)
- func RecordSemaphoreWait(ctx context.Context, waitMs float64)
- 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 RecordWorkerTaskOutcome(ctx context.Context, metrics WorkerTaskOutcomeMetrics)
- 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 BrokerStreamStats
- type Config
- type CrawlerPhaseMetrics
- type DBPoolSnapshot
- type Providers
- type RedisPoolSnapshot
- type WorkerTaskMetrics
- type WorkerTaskOutcomeMetrics
- type WorkerTaskSpanInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseOTLPHeaders ¶ added in v0.33.0
ParseOTLPHeaders parses the OTEL_EXPORTER_OTLP_HEADERS env var format.
func RecordBrokerAutoclaim ¶ added in v0.33.0
result: "reclaimed" | "dead_letter".
func RecordBrokerCounterPELSkew ¶ added in v0.33.1
Persistent non-zero skew = counter leaked (fix-broker-counter-drift). jobID kept for call-site stability; omitted from labels (cardinality).
func RecordBrokerCounterSyncSkew ¶ added in v0.33.0
jobID kept for call-site stability; omitted from labels (cardinality).
func RecordBrokerDispatch ¶ added in v0.33.0
outcome: "ok" | "err" | "capacity" | "paced". jobID kept for call-site stability.
func RecordBrokerMessageAge ¶ added in v0.33.0
Call once per parsed XREADGROUP message.
func RecordBrokerOutbox ¶ added in v0.33.0
func RecordBrokerOutboxSweep ¶ added in v0.33.1
outcome must be "dispatched" | "retried" | "dead_lettered" (mutually exclusive per row).
func RecordBrokerPELWithoutConsumer ¶ added in v0.33.1
Healthy reading is always zero; non-zero = dispatch/consume diverged and those jobs' tasks are stalled.
func RecordBrokerPacerDelay ¶ added in v0.33.0
domain must NOT be a label — unbounded cardinality.
func RecordBrokerPacerPushback ¶ added in v0.33.0
reason: "gate" (domain-gate NX hold) | "rate_limited" (release feedback). domain must NOT be a label — unbounded cardinality.
func RecordBrokerRedisPing ¶ added in v0.33.0
func RecordBrokerRedisPool ¶ added in v0.33.0
func RecordBrokerRedisPool(ctx context.Context, snap RedisPoolSnapshot)
func RecordBrokerStreamStats ¶ added in v0.33.0
func RecordBrokerStreamStats(ctx context.Context, s BrokerStreamStats)
Per-job drill-down lives on traces/logs (which carry job_id), not metrics.
func RecordCrawlerPhase ¶ added in v0.32.6
func RecordCrawlerPhase(ctx context.Context, metrics CrawlerPhaseMetrics)
func RecordDBPoolRejection ¶
func RecordDBPoolStats ¶
func RecordDBPoolStats(ctx context.Context, snapshot DBPoolSnapshot)
func RecordDBPressureAdjustment ¶ added in v0.32.0
direction must be "up" or "down".
func RecordDBPressureStats ¶ added in v0.32.0
Call alongside RecordDBPoolStats for a complete pool+pressure snapshot.
func RecordFDStats ¶ added in v0.31.4
func RecordHTMLPersistBodyBytes ¶ added in v0.33.9
func RecordHTMLPersistQueueDepth ¶ added in v0.33.9
Used to tune the HTML_PERSIST_QUEUE / HTML_PERSIST_WORKERS ratio.
func RecordHTMLPersistUpload ¶ added in v0.33.9
outcome: "ok" | "err" | "skipped".
func RecordHTMLPersistUploadDuration ¶ added in v0.33.9
func RecordJobConcurrencySnapshot ¶
func RecordJobConcurrencySnapshot(ctx context.Context, jobID string, runningTasks int64, concurrencyLimit int64, unlimited bool)
jobID kept for call-site stability; omitted from labels (cardinality).
func RecordJobInfoCacheHit ¶
jobID kept for call-site stability; omitted from labels (cardinality).
func RecordJobInfoCacheMiss ¶
func RecordJobInfoCacheSize ¶
func RecordLighthouseRun ¶ added in v0.33.10
outcome: "succeeded" | "failed" | "skipped_quota" | "shed". "shed" = soft memory-shed circuit breaker deferred the audit; a rising shed rate means the analysis fleet is memory-saturated.
func RecordLighthouseRunDuration ¶ added in v0.33.10
outcome label is load-bearing — failures cluster at timeout and would otherwise distort the success-path latency distribution.
func RecordLighthouseRunRetry ¶ added in v0.33.10
reason MUST come from the runner's transientStderrSubstrings list (e.g. "target_crashed"); never pass free-form error text — cardinality.
func RecordLighthouseScheduled ¶ added in v0.33.10
band: "fastest" | "slowest" | "reconcile". jobID kept for call-site stability.
func RecordSemaphoreWait ¶ added in v0.32.0
func RecordTaskClaimAttempt ¶
func RecordTaskClaimAttempt(ctx context.Context, jobID string, latency time.Duration, status string)
jobID kept for call-site stability; omitted from labels (cardinality).
func RecordTaskWaiting ¶
func RecordWorkerConcurrency ¶
delta: +1 starting, -1 completing. capacity: pass >0 only on startup.
func RecordWorkerTask ¶
func RecordWorkerTask(ctx context.Context, metrics WorkerTaskMetrics)
job.id must NOT be a metric label — Prometheus active-series cardinality. Per-job pivot lives on the worker.process_task span attributes.
func RecordWorkerTaskFailure ¶
func RecordWorkerTaskOutcome ¶ added in v0.32.6
func RecordWorkerTaskOutcome(ctx context.Context, metrics WorkerTaskOutcomeMetrics)
func RecordWorkerTaskRetry ¶
func StartWorkerTaskSpan ¶
Types ¶
type BrokerStreamStats ¶ added in v0.33.0
Pre-aggregated across active jobs; the per-job job.id label was dropped for Mimir cardinality and dashboards already used sum(...).
type CrawlerPhaseMetrics ¶ added in v0.32.6
type DBPoolSnapshot ¶
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
}