You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug in the Torrust Demo with the new metrics that I can't reproduce locally.
I will introduce some changes to the metrics package to help me find the problem.
I will also make other minor changes in that package and other packages.
Subtasks
metrics package:
Return errors instead of panicking in the MetricCollection struct.
Add tracing crate.
Return an optional in get_counter_value and get_gauge_value. They are returning the default value for that metric type if the metric does not exist. That the behavior we want for increase_counter and set_gauge but not for these methods. They are currently used only in tests.
pubfnrun_event_listener(&mutself,receiver:Receiver<Event>){let stats_repository = self.repository.clone();// TARGET should be HTTP_TRACKER_CORE
tracing::info!(TARGET,"Starting event listener");
tokio::spawn(asyncmove{dispatch_events(receiver, stats_repository).await;
tracing::info!(TARGET,"Event listener finished");});}
NOTE: This won't help identify a panic inside the dispatch_events function. We should log the error returned by tokio::spawn, but the function is not async. We need to move the function call from the app setup to the app start as described here.
Activity
refactor: [torrust#1445] new macro to create metric names
refactor: [torrust#1445] replace metric name constructor by macro
refactor: [torrust#1445] new macro to create metric label names
refactor: [torrust#1445] replace metric label name constructor by macro
refactor: [torrust#1445] return optionals for metric values in metric…
refactor: [torrust#1445] remove panic from MetricColelction::new method
refactor: [torrust#1445] return errors instead of panicking in the Me…
refactor: [torrust#1445] return errors instead of panicking in the Sa…
feat: [torrust#1445] add logs to the event listener's initialization
feat: [torrust#1445] add request kind label to total errors metric
refactor: [torrust#1445] rename metric label
feat: [torrust#1445] add logs for metrics initialization
Merge #1467: Overhaul stats: Refactor metrics (part 1)