opsmetrics

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package opsmetrics holds the operational metrics every role exports on /metrics (review 2026-11 OP-1): background jobs (depth, lag, failures by kind), messages handed to sending providers by adapter and result, webhook ingest lag, outgoing webhook deliveries and the database pool.

Counters are package variables, counted where the work happens; the queue gauges are read from the database at scrape time, at most every 15 seconds, so a busy Prometheus never loads the database.

Index

Constants

View Source
const (
	Accepted = "accepted"
	Rejected = "rejected"
	Deferred = "deferred"
	Failed   = "failed"
)

Message results.

Variables

View Source
var (
	// ProviderMessages counts the messages handed to sending providers:
	// accepted, rejected (permanently), deferred (a temporary refusal,
	// retried) or failed (the whole call failed).
	ProviderMessages = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reputecast_provider_messages_total",
		Help: "Messages handed to sending providers, by adapter and result (accepted, rejected, deferred, failed).",
	}, []string{"provider", "result"})
	// ProviderCalls counts send calls to providers, by adapter and result
	// (ok or error).
	ProviderCalls = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reputecast_provider_calls_total",
		Help: "Send calls to sending providers, by adapter and result (ok, error).",
	}, []string{"provider", "result"})
	// JobFailures counts failed job attempts by kind: retried, discarded
	// (out of attempts) or panicked.
	JobFailures = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reputecast_job_failures_total",
		Help: "Failed background job attempts, by kind and outcome (retry, discarded, panic).",
	}, []string{"kind", "outcome"})
	// WebhookDeliveries counts attempts to deliver outgoing webhooks.
	WebhookDeliveries = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reputecast_webhook_deliveries_total",
		Help: "Outgoing webhook delivery attempts, by result (delivered, retrying, dead).",
	}, []string{"result"})
	// IngestRequests counts provider webhook requests received.
	IngestRequests = prometheus.NewCounterVec(prometheus.CounterOpts{
		Name: "reputecast_ingest_requests_total",
		Help: "Provider webhook requests received, by channel (email, sms, whatsapp) and result (stored, rejected).",
	}, []string{"channel", "result"})
)

Counters, counted where the work happens.

Functions

func Register

func Register(reg prometheus.Registerer, pool *pgxpool.Pool, queues ...string)

Register adds the counters and the database collectors to reg. queues are the job queues whose lag always shows, 0 when nothing waits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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