diff --git a/internal/metrics/metrics.go b/internal/metrics/metrics.go index 952855b..edcaec3 100644 --- a/internal/metrics/metrics.go +++ b/internal/metrics/metrics.go @@ -2,6 +2,7 @@ package metrics import ( "context" + "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" "go.opentelemetry.io/otel/metric/global" @@ -34,9 +35,9 @@ func newServiceMetrics() *serviceMetrics { return &serviceMetrics{ pubsubMeter: meter, - publishCount: pubsubM.NewInt64Counter("pubsub.publish.count", + publishCount: pubsubM.NewInt64Counter("rusi.pubsub.publish.count", metric.WithDescription("The number of publishes")), - subscribeDuration: pubsubM.NewInt64Histogram("pubsub.subscribe.duration", + subscribeDuration: pubsubM.NewInt64Histogram("rusi.pubsub.processing.duration", metric.WithDescription("The duration of a message execution"), metric.WithUnit("milliseconds")), } diff --git a/internal/metrics/prometheus.go b/internal/metrics/prometheus.go index 9051412..4e933bc 100644 --- a/internal/metrics/prometheus.go +++ b/internal/metrics/prometheus.go @@ -2,6 +2,8 @@ package metrics import ( "context" + "time" + "go.opentelemetry.io/otel/exporters/prometheus" "go.opentelemetry.io/otel/metric/global" "go.opentelemetry.io/otel/sdk/export/metric/aggregation" @@ -12,11 +14,10 @@ import ( "go.opentelemetry.io/otel/sdk/resource" semconv "go.opentelemetry.io/otel/semconv/v1.4.0" "k8s.io/klog/v2" - "time" ) func SetupPrometheusMetrics(appId string) *prometheus.Exporter { - config := prometheus.Config{} + config := prometheus.Config{DefaultHistogramBoundaries: []float64{10, 100, 1000, 10000, 100000}} r, _ := resource.New(context.Background(), resource.WithHost(), resource.WithAttributes(semconv.ServiceNameKey.String(appId)))