mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2026-11-15 05:06:53 +00:00
feat(metrics): Record metrics with OpenTelemetry and export over OTLP
This commit is contained in:
1 parent
e96b6e6665
commit
5185045cb6
33 files changed
+1118
-455
No files matched your search
@@ -1,7 +1,7 @@
|
||||
use std::{borrow::Cow, fmt::Debug, mem, time::Instant};
|
||||
|
||||
use conduwuit::{
|
||||
Err, Error, Result, debug, debug_error, debug_info, debug_warn, err, metrics::OutcomeLabels,
|
||||
Err, Error, Result, debug, debug_error, debug_info, debug_warn, err, metrics::KeyValue,
|
||||
trace, utils::response::LimitReadExt,
|
||||
};
|
||||
use ipaddress::IPAddress;
|
||||
@@ -191,10 +191,9 @@ impl super::Service {
|
||||
self.services
|
||||
.server
|
||||
.metrics
|
||||
.prometheus
|
||||
.federation_request_duration
|
||||
.get_or_create(&OutcomeLabels { outcome })
|
||||
.observe(elapsed.as_secs_f64());
|
||||
.instruments
|
||||
.federation_outgoing_request_duration
|
||||
.record(elapsed.as_secs_f64(), &[KeyValue::new("outcome", outcome)]);
|
||||
match response {
|
||||
| Ok(response) =>
|
||||
self.handle_response::<T>(dest, actual, &method, &url, response)
|
||||
|
||||
Reference in new issue
Block a user