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
//! `/metrics` route — Prometheus text-format scrape target.
//!
//! Returns the current contents of the global Prometheus recorder
//! installed at startup by the API binary. The handler is a near-zero-
//! cost call: `PrometheusHandle::render` walks the registered metric
//! sets and emits the text-format representation.
//!
//! Note: this is the *API* metrics endpoint. The worker binary has its
//! own independent endpoint on a separate port (default 9091) so a
//! single Prometheus scrape config can target each process directly.
use State;
use ;
use ;
use crateAppState;
/// `GET /metrics` — Prometheus text format. Content-Type is set to the
/// MIME type Prometheus expects (`text/plain; version=0.0.4`) so
/// scrapers don't fall back to a more expensive negotiation path.
pub async