Skip to content

Commit

Permalink
using combined gauge names again, was not woking with labels
Browse files Browse the repository at this point in the history
  • Loading branch information
SurfingNerd committed Sep 7, 2023
1 parent dbaf056 commit 4f8543e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/util/stats/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ impl PrometheusRegistry {

/// Adds a new prometheus gauge with a label
pub fn register_gauge_with_label(&mut self, name: &str, help: &str, label: &str, value: i64) {
//let label_formated = format!("{}", label);
let name_formatted = format!("{}{}", self.prefix, name);
let mut opts = prometheus::Opts::new(name_formatted, help);
let label_formated = format!("{}{}",name, label);
// let label_formated = format!("{}{}", self.prefix, name);
let opts = prometheus::Opts::new(label_formated, help);

// add labels here .
opts.variable_labels.push(label.to_string());
//&&opts.variable_labels.push(label.to_string());

match prometheus::IntGauge::with_opts(opts) {
Ok(g) => {
Expand Down

0 comments on commit 4f8543e

Please sign in to comment.