1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Wiring metrics for `whatsapp-rust`.
//!
//! Run with:
//! cargo run --example metrics --features metrics
//!
//! The library only *emits* metrics through the `metrics` facade (the `wa_*`
//! counters/histograms/gauges in `whatsapp_rust::telemetry`). It never installs a
//! recorder or depends on Prometheus/OTLP; the application does, as shown here.
//! With the `metrics` feature off there is no dependency and every emit is a
//! zero-cost no-op.
//!
//! Metric labels are strictly categorical (outcome, kind, namespace, ...); JIDs,
//! phone numbers and message ids are never used as labels.
// The rendered scrape is this example's output, not a diagnostic to route
// through `log`.