-
I noticed there is an example with otel support, |
Beta Was this translation helpful? Give feedback.
Answered by
tdakkota
May 9, 2024
Replies: 1 comment 1 reply
-
You can create a Prometheus exporter, err := prometheus.New()
if err != nil {
return err
}
provider := metric.NewMeterProvider(metric.WithReader(exporter))
srv, err := <api_package>.NewServer(<api_package>.WithMeterProvider(provider))
if err != nil {
return err
}
http.Handle("/metrics", promhttp.Handler())
http.Handle("/api", http.StripPrefix("/api", srv))
http.ListenAndServe(":8080", nil) There is OpenTelemery SDK example. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zwpaper
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can create a Prometheus
MeterProvider
by yourself:There is OpenTelemery SDK example.