Skip to content

Commit

Permalink
Fix missing global meter (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthonycorbacho committed Jul 13, 2023
1 parent 41a287f commit f804b49
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions kit/telemetry/meter.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/http"

"github.com/prometheus/client_golang/prometheus/promhttp"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/prometheus"
"go.opentelemetry.io/otel/sdk/metric"
)
Expand Down Expand Up @@ -38,6 +39,8 @@ func NewMeter(name string, opts ...func(option *MeterOption)) (*metric.MeterProv
metric.WithReader(exporter),
)

otel.SetMeterProvider(provider)

go func() {
mux := http.NewServeMux()
mux.Handle("/metrics", promhttp.Handler())
Expand Down

0 comments on commit f804b49

Please sign in to comment.