From 6213977b592dfb90622dedb76d6d6623e2a907aa Mon Sep 17 00:00:00 2001 From: darkyzhou Date: Tue, 28 Mar 2023 15:22:29 +0800 Subject: [PATCH] fix(shared/metrics): add missing `service.instance.id` resource --- src/shared/metrics.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/shared/metrics.rs b/src/shared/metrics.rs index 7f91bb2..1148dda 100644 --- a/src/shared/metrics.rs +++ b/src/shared/metrics.rs @@ -19,6 +19,10 @@ pub static METRICS_RESOURCE: Lazy = Lazy::new(|| { "service.version", conf::env::COMMIT_TAG.or(*conf::env::COMMIT_SHA).unwrap_or("unknown"), ), + KeyValue::new( + "service.instance.id", + format!("{}-{}", *conf::HOSTNAME, nano_id::base62::<8>()), + ), KeyValue::new("host.name", conf::HOSTNAME.clone()), ];