MCPcopy
hub / github.com/cortexlabs/cortex / NewPrometheusStatsReporter

Function NewPrometheusStatsReporter

pkg/activator/request_stats.go:34–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32}
33
34func NewPrometheusStatsReporter() *PrometheusStatsReporter {
35 inFlightRequestsGauge := promauto.NewGaugeVec(prometheus.GaugeOpts{
36 Name: "cortex_in_flight_requests",
37 Help: "The number of in-flight requests for a cortex API",
38 }, []string{"api_name"})
39
40 return &PrometheusStatsReporter{
41 handler: promhttp.Handler(),
42 inFlightRequests: inFlightRequestsGauge,
43 }
44}
45
46func (r *PrometheusStatsReporter) AddAPI(apiName string) {
47 r.inFlightRequests.WithLabelValues(apiName).Set(0)

Callers 1

mainFunction · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected