From 6acb0520f2402a24b316b5b76c8bf12cbcb20cc9 Mon Sep 17 00:00:00 2001 From: Leonidas Vrachnis Date: Wed, 29 May 2024 11:36:45 +0200 Subject: [PATCH] chore: expose otel version from stats library (#488) Co-authored-by: Francesco Casula --- stats/otel.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/stats/otel.go b/stats/otel.go index 28af17c4..9b45d371 100644 --- a/stats/otel.go +++ b/stats/otel.go @@ -13,6 +13,7 @@ import ( "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promhttp" "github.com/spf13/cast" + ootel "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/attribute" "go.opentelemetry.io/otel/metric" noopMetric "go.opentelemetry.io/otel/metric/noop" @@ -62,6 +63,10 @@ type otelStats struct { prometheusGatherer prometheus.Gatherer } +func OtelVersion() string { + return ootel.Version() +} + func (s *otelStats) Start(ctx context.Context, goFactory GoRoutineFactory) error { if !s.config.enabled.Load() { return nil