diff --git a/Cargo.lock b/Cargo.lock index 1d64d00..819b244 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1845,7 +1845,7 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "restate-operator" -version = "1.0.0" +version = "1.0.1" dependencies = [ "actix-web", "anyhow", diff --git a/Cargo.toml b/Cargo.toml index 09af1a4..837bb45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "restate-operator" -version = "1.0.0" +version = "1.0.1" authors = ["restate.dev"] edition = "2021" rust-version = "1.75" diff --git a/charts/restate-operator-helm/Chart.yaml b/charts/restate-operator-helm/Chart.yaml index 4ecbfd5..a0e5c39 100644 --- a/charts/restate-operator-helm/Chart.yaml +++ b/charts/restate-operator-helm/Chart.yaml @@ -2,4 +2,4 @@ apiVersion: v2 name: restate-operator-helm description: An operator for Restate clusters type: application -version: "1.0.0" +version: "1.0.1" diff --git a/src/lib.rs b/src/lib.rs index ca8f988..e12ef9b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -32,8 +32,15 @@ pub enum Error { pub type Result = std::result::Result; impl Error { - pub fn metric_label(&self) -> String { - format!("{self:?}").to_lowercase() + pub fn metric_label(&self) -> &'static str { + match self { + Error::SerializationError(_) => "SerializationError", + Error::KubeError(_) => "KubeError", + Error::FinalizerError(_) => "FinalizerError", + Error::NameConflict => "NameConflict", + Error::NotReady { .. } => "NotReady", + Error::InvalidSigningKeyError(_) => "InvalidSigningKeyError", + } } } diff --git a/src/metrics.rs b/src/metrics.rs index 1aac653..7096ba6 100644 --- a/src/metrics.rs +++ b/src/metrics.rs @@ -50,7 +50,7 @@ impl Metrics { pub fn reconcile_failure(&self, rc: &RestateCluster, e: &Error) { self.failures - .with_label_values(&[rc.name_any().as_ref(), e.metric_label().as_ref()]) + .with_label_values(&[rc.name_any().as_ref(), e.metric_label()]) .inc() }