Documentation
¶
Overview ¶
Package metrics holds the Prometheus metrics, served on METRICS_ADDR. The names and labels are part of the 1.x API (README "Metrics").
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Events = factory.NewCounterVec(prometheus.CounterOpts{ Name: "tokenmeter_events_total", Help: "Usage events received, by result: created, duplicate or invalid.", }, []string{"result"}) Requests = factory.NewCounterVec(prometheus.CounterOpts{ Name: "tokenmeter_requests_total", Help: "API requests by transport (http, grpc), route or RPC, and status code.", }, []string{"transport", "route", "code"}) RequestDuration = factory.NewHistogramVec(prometheus.HistogramOpts{ Name: "tokenmeter_request_duration_seconds", Help: "API request duration by transport and route or RPC.", Buckets: []float64{.001, .0025, .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10}, }, []string{"transport", "route"}) StorageErrors = factory.NewCounterVec(prometheus.CounterOpts{ Name: "tokenmeter_storage_errors_total", Help: "Failed storage operations by store (postgres, clickhouse) and operation.", }, []string{"store", "op"}) ReadFallbacks = factory.NewCounter(prometheus.CounterOpts{ Name: "tokenmeter_read_fallbacks_total", Help: "Reports answered from Postgres because a ClickHouse query failed.", }) ClickHouseEnabled = factory.NewGauge(prometheus.GaugeOpts{ Name: "tokenmeter_clickhouse_enabled", Help: "1 when CLICKHOUSE_ENABLED is set.", }) ClickHouseUp = factory.NewGauge(prometheus.GaugeOpts{ Name: "tokenmeter_clickhouse_serving", Help: "1 while reports are served from ClickHouse, 0 while from Postgres (not connected, backfilling, or its last query failed).", }) Copied = factory.NewCounter(prometheus.CounterOpts{ Name: "tokenmeter_clickhouse_copied_events_total", Help: "Events copied from the outbox to ClickHouse.", }) InsertFailures = factory.NewCounterVec(prometheus.CounterOpts{ Name: "tokenmeter_clickhouse_insert_failures_total", Help: "Failed ClickHouse inserts, by reason: unreachable (retried) or refused (postponed).", }, []string{"reason"}) OutboxEvents = factory.NewGauge(prometheus.GaugeOpts{ Name: "tokenmeter_clickhouse_outbox_events", Help: "Events waiting in the outbox for ClickHouse, counted up to 1000000.", }) OutboxOldest = factory.NewGauge(prometheus.GaugeOpts{ Name: "tokenmeter_clickhouse_outbox_oldest_seconds", Help: "Age of the oldest event waiting for ClickHouse; 0 when none waits.", }) BuildInfo = factory.NewGaugeVec(prometheus.GaugeOpts{ Name: "tokenmeter_build_info", Help: "Always 1; the version label names the running release.", }, []string{"version"}) )
View Source
var Registry = prometheus.NewRegistry()
Registry holds only tokenmeter's metrics plus the Go and process ones.
Functions ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.