MetricsHandler returns the Prometheus HTTP handler for serving the /metrics endpoint. Returns nil if SetupOTelSDK has not been called or metrics are not configured.
()
| 47 | // MetricsHandler returns the Prometheus HTTP handler for serving the /metrics endpoint. |
| 48 | // Returns nil if SetupOTelSDK has not been called or metrics are not configured. |
| 49 | func MetricsHandler() http.Handler { |
| 50 | return metricsHandler |
| 51 | } |
| 52 | |
| 53 | // SetupOTelSDK bootstraps the OpenTelemetry pipeline. |
| 54 | // If it does not return an error, make sure to call shutdown for proper cleanup. |
no outgoing calls