29#include <prom/prom.hpp>
36inline std::shared_ptr<prom::Scope>&
scope() {
37 static std::shared_ptr<prom::Scope> sc =
38 prom::scope(
"conduit",
39 prom::ScopeConfig{.prefix =
"conduit_",
40 .display = comms::DisplayInfo{
42 .description =
"conduit event-bus metrics.",
49 static prom::Counter m =
50 scope()->counter({.name =
"events_published_total",
51 .help =
"Envelopes that entered the dispatch pipeline."});
58 static prom::Counter m =
scope()->counter(
59 {.name =
"events_dropped_total",
60 .help =
"Envelopes dropped before dispatch (middleware veto or routing conflict)."});
67 static prom::Counter m =
68 scope()->counter({.name =
"listener_invocations_total",
69 .help =
"Listener handler calls during fan-out (per matched listener)."});
75 static prom::Counter m =
scope()->counter(
76 {.name =
"listener_errors_total", .help =
"Listener handlers that threw during fan-out."});
83 static prom::Counter m =
scope()->counter(
84 {.name =
"transport_errors_total",
85 .help =
"Transport-level inbound failures (e.g. an undecodable message)."});
91 static prom::Gauge m =
scope()->gauge(
92 {.name =
"listeners", .help =
"Live listener subscriptions registered on a bus."});
100 static prom::Histogram m =
scope()->histogram(
101 {.name =
"dispatch_seconds",
103 "Wall-clock seconds from publish to the end of the synchronous dispatch pipeline."});
Definition metrics.hpp:33
prom::Counter & listener_invocations()
Listener handler calls during fan-out (counts every matched listener, summed over all delivered envel...
Definition metrics.hpp:66
std::shared_ptr< prom::Scope > & scope()
The shared conduit scope; applies the conduit_ prefix to every metric.
Definition metrics.hpp:36
prom::Counter & events_published()
Envelopes that entered the dispatch pipeline (one per Bus::publish).
Definition metrics.hpp:48
prom::Counter & transport_errors()
Transport-level inbound failures, selected by the transport label ("redis", "amqp",...
Definition metrics.hpp:82
prom::Counter & listener_errors()
Listener handlers that threw during fan-out.
Definition metrics.hpp:74
prom::Counter & events_dropped()
Envelopes dropped before listener fan-out (a middleware before_dispatch returned false,...
Definition metrics.hpp:57
prom::Gauge & listeners()
Live listener subscriptions across all buses in the process.
Definition metrics.hpp:90
prom::Histogram & dispatch_seconds()
Wall-clock seconds from publish to the end of the synchronous dispatch pipeline.
Definition metrics.hpp:99