pomerium/internal/telemetry/http.go
Caleb Doxsey e2ebef44ef
telemetry: add installation id (#2017)
* telemetry: add installation id

* set installation id globally

* remove unneeded changes
2021-03-24 07:22:54 -06:00

17 lines
701 B
Go

package telemetry
import (
"net/http"
"github.com/pomerium/pomerium/internal/telemetry/metrics"
)
// HTTPStatsRoundTripper creates tracing and metrics RoundTripper for a pomerium service
func HTTPStatsRoundTripper(getInstallationID func() string, service string, destination string) func(next http.RoundTripper) http.RoundTripper {
return metrics.HTTPMetricsRoundTripper(getInstallationID, ServiceName(service), destination)
}
// HTTPStatsHandler creates tracing and metrics Handler for a pomerium service
func HTTPStatsHandler(getInstallationID func() string, service string) func(next http.Handler) http.Handler {
return metrics.HTTPMetricsHandler(getInstallationID, ServiceName(service))
}