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
Next Next commit
Update prometheus-client version
  • Loading branch information
emschwartz committed May 16, 2023
commit 7cbe05323782dc72f19b3bad9ea52489e069d716
2 changes: 1 addition & 1 deletion autometrics/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ prometheus = { version = "0.13", default-features = false, optional = true }
const_format = { version = "0.2", features = ["rust_1_51"], optional = true }

# Used for prometheus-client feature
prometheus-client = { version = "0.20", optional = true }
prometheus-client = { version = "0.21.1", optional = true }

[dev-dependencies]
regex = "1.7"
Expand Down
8 changes: 3 additions & 5 deletions autometrics/src/labels.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use crate::{constants::*, objectives::*};
use prometheus_client::encoding::EncodeLabelKey;
#[cfg(feature = "prometheus-client")]
use prometheus_client::encoding::{
EncodeLabelSet, EncodeLabelValue, LabelSetEncoder, LabelValueEncoder,
EncodeLabelKey, EncodeLabelSet, EncodeLabelValue, LabelValueEncoder,
};
use std::ops::Deref;

Expand Down Expand Up @@ -58,8 +57,8 @@ pub(crate) enum ResultLabel {
impl EncodeLabelValue for ResultLabel {
fn encode(&self, encoder: &mut LabelValueEncoder) -> Result<(), std::fmt::Error> {
match self {
ResultLabel::Ok => OK_KEY.encode(encoder),
ResultLabel::Error => ERROR_KEY.encode(encoder),
ResultLabel::Ok => EncodeLabelValue::encode(&OK_KEY, encoder),
ResultLabel::Error => EncodeLabelValue::encode(&ERROR_KEY, encoder),
}
}
}
Expand Down Expand Up @@ -120,7 +119,6 @@ impl CounterLabels {
pub struct HistogramLabels {
pub function: &'static str,
pub module: &'static str,
/// The SLO name, objective percentile, and latency threshold
pub objective_name: &'static str,
pub objective_percentile: ObjectivePercentile,
pub objective_latency_threshold: ObjectiveLatency,
Expand Down