MCPcopy Create free account
hub / github.com/authorizerdev/authorizer / Init

Function Init

internal/metrics/metrics.go:252–269  ·  view source on GitHub ↗

Init registers all metrics with the default prometheus registry. It is safe to call multiple times; registration happens only once.

()

Source from the content-addressed store, hash-verified

250// Init registers all metrics with the default prometheus registry.
251// It is safe to call multiple times; registration happens only once.
252func Init() {
253 initOnce.Do(func() {
254 prometheus.MustRegister(HTTPRequestsTotal)
255 prometheus.MustRegister(HTTPRequestDuration)
256 prometheus.MustRegister(AuthEventsTotal)
257 prometheus.MustRegister(APIOperationsTotal)
258 prometheus.MustRegister(ActiveSessions)
259 prometheus.MustRegister(SecurityEventsTotal)
260 prometheus.MustRegister(GraphQLErrorsTotal)
261 prometheus.MustRegister(GraphQLLimitRejectionsTotal)
262 prometheus.MustRegister(GraphQLRequestDuration)
263 prometheus.MustRegister(DBHealthCheckTotal)
264 prometheus.MustRegister(ClientIDHeaderMissingTotal)
265 prometheus.MustRegister(FgaChecksTotal)
266 prometheus.MustRegister(FgaCheckDuration)
267 prometheus.MustRegister(FgaOperationsTotal)
268 })
269}
270
271// GraphQLOperationPrometheusLabel maps an operation name to a bounded-cardinality value
272// suitable for Prometheus labels (never use raw client-supplied names as labels).

Callers 2

TestMainFunction · 0.92
runRootFunction · 0.92

Calls

no outgoing calls

Tested by 1

TestMainFunction · 0.74