Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
use a const to prevent repetition
  • Loading branch information
mellowagain committed Nov 13, 2023
commit f9b3e5818c8297fec1cf5dee7b16a8821a00eab0
3 changes: 3 additions & 0 deletions autometrics/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Version of the autometrics spec we are targeting
pub const AUTOMETRICS_SPEC_TARGET: &str = "1.0.0";

// Metrics
pub const COUNTER_NAME: &str = "function.calls";
pub const HISTOGRAM_NAME: &str = "function.calls.duration";
Expand Down
2 changes: 1 addition & 1 deletion autometrics/src/labels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl BuildInfoLabels {
service_name: &get_settings().service_name,
repo_url,
repo_provider,
autometrics_version: "1.0.0"
autometrics_version: AUTOMETRICS_SPEC_TARGET
}
}

Expand Down
2 changes: 1 addition & 1 deletion autometrics/src/tracker/prometheus.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl TrackMetrics for PrometheusTracker {
build_info_labels.service_name,
build_info_labels.repo_url,
build_info_labels.repo_provider,
"1.0.0" // autometrics_version
AUTOMETRICS_SPEC_TARGET
])
.set(1);
});
Expand Down