mirror of
https://gitlab.computer.surgery/matrix/grapevine.git
synced 2025-12-18 00:01:24 +01:00
set up opentelemetry for metrics
Also adds an `allow_prometheus` option (disabled by default) to expose a `/metrics` endpoint that returns Prometheus data.
This commit is contained in:
parent
94fda7c875
commit
a0b92c82e8
5 changed files with 97 additions and 2 deletions
|
|
@ -412,6 +412,15 @@ fn routes(config: &Config) -> Router {
|
|||
.put(c2s::send_state_event_for_empty_key_route),
|
||||
);
|
||||
|
||||
let router = if config.allow_prometheus {
|
||||
router.route(
|
||||
"/metrics",
|
||||
get(|| async { observability::METRICS.export() }),
|
||||
)
|
||||
} else {
|
||||
router
|
||||
};
|
||||
|
||||
let router = router
|
||||
.route(
|
||||
"/_matrix/client/r0/rooms/:room_id/initialSync",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue