mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
instrumentation: these features have been enabled for a while (#81617)
Signed-off-by: bergquist <carl.bergquist@gmail.com>
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user