From 7e988106badcabc6157b8a9cde494fcd12b19782 Mon Sep 17 00:00:00 2001 From: hfuss Date: Wed, 4 Dec 2024 18:48:34 -0500 Subject: [PATCH] [metrics] Configurable Prefix and Avoiding 'ff_' in Tags Signed-off-by: hfuss --- pkg/ffresty/metrics.go | 1 + pkg/metric/metric.go | 25 ++++++++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) create mode 100644 pkg/ffresty/metrics.go diff --git a/pkg/ffresty/metrics.go b/pkg/ffresty/metrics.go new file mode 100644 index 0000000..6857822 --- /dev/null +++ b/pkg/ffresty/metrics.go @@ -0,0 +1 @@ +package ffresty diff --git a/pkg/metric/metric.go b/pkg/metric/metric.go index 3271a86..3b20243 100644 --- a/pkg/metric/metric.go +++ b/pkg/metric/metric.go @@ -32,12 +32,12 @@ import ( var allowedNameStringRegex = `^[a-zA-Z]+[a-zA-Z0-9_]*[a-zA-Z0-9]$` var ffMetricsPrefix = "ff" -const compulsoryComponentLabel = fireflySystemLabelsPrefix + "component" +const compulsoryComponentLabel = "component" /** Metrics names should follow the convention documented in https://prometheus.io/docs/practices/naming/. Below is an example breakdown of the term mapping: -* Example metric: ff _ api_server_rest _ requests _ total {ff_component="tm" , method = "Get" ...} - ff _ token _ mint_duration _ seconds {ff_component="" , status = "Success" ...} -* Mapping : _ _ _ {ff_component= ,