instrumentation: these features have been enabled for a while (#81617)

Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
Carl Bergquist
2024-02-06 09:29:41 +01:00
committed by GitHub
parent bd48c06f95
commit c9de794d7f
7 changed files with 4 additions and 51 deletions

View File

@@ -35,20 +35,12 @@ func RequestMetrics(features featuremgmt.FeatureToggles, cfg *setting.Cfg, promR
},
)
histogramLabels := []string{"handler", "status_code", "method"}
if features.IsEnabledGlobally(featuremgmt.FlagRequestInstrumentationStatusSource) {
histogramLabels = append(histogramLabels, "status_source")
}
histogramLabels := []string{"handler", "status_code", "method", "status_source", "slo_group"}
if cfg.MetricsIncludeTeamLabel {
histogramLabels = append(histogramLabels, "grafana_team")
}
if features.IsEnabledGlobally(featuremgmt.FlagHttpSLOLevels) {
histogramLabels = append(histogramLabels, "slo_group")
}
histogramOptions := prometheus.HistogramOpts{
Namespace: "grafana",
Name: "http_request_duration_seconds",
@@ -104,18 +96,12 @@ func RequestMetrics(features featuremgmt.FeatureToggles, cfg *setting.Cfg, promR
labelValues := []string{handler, code, r.Method}
rmd := requestmeta.GetRequestMetaData(r.Context())
if features.IsEnabled(r.Context(), featuremgmt.FlagRequestInstrumentationStatusSource) {
labelValues = append(labelValues, string(rmd.StatusSource))
}
labelValues = append(labelValues, string(rmd.StatusSource), string(rmd.SLOGroup))
if cfg.MetricsIncludeTeamLabel {
labelValues = append(labelValues, rmd.Team)
}
if features.IsEnabled(r.Context(), featuremgmt.FlagHttpSLOLevels) {
labelValues = append(labelValues, string(rmd.SLOGroup))
}
// avoiding the sanitize functions for in the new instrumentation
// since they dont make much sense. We should remove them later.
histogram := httpRequestDurationHistogram.