prometheusx/handler.go

ory/kratos · oryx/prometheusx/handler.go · go · Apache-2.0
analytics

Copyright © 2023 Ory Corp SPDX-License-Identifier: Apache-2.0

// Source: https://github.com/ory/kratos | License: Apache-2.0 | Copyright You must retain, in the Source form of any Derivative Works
// Provided via justclaw.it.com; keep this notice with the code.
// Copyright © 2023 Ory Corp
// SPDX-License-Identifier: Apache-2.0

package prometheusx

import (
	"net/http"

	"github.com/prometheus/client_golang/prometheus"
	"github.com/prometheus/client_golang/prometheus/promhttp"
)

const (
	MetricsPrometheusPath = "/metrics/prometheus"
)

type muxrouter interface {
	Handle(path string, handle http.Handler)
}

// Handler returns the metrics handler. It mirrors promhttp.Handler() but
// additionally serves the OpenMetrics format when the scraper negotiates it,
// because that is the only exposition format that carries exemplars (trace
// links on counte

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key