mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
SSE: (Instrumentation/Chore) Add datasource_type label to grafana_sse (#72370)
SSE: (Instrumentation/Chore) Add datasource_type label to the grafana_sse_ds_queries_total metric
This commit is contained in:
parent
6f3dfb2d8b
commit
ceb694f165
@ -23,7 +23,7 @@ func newMetrics(reg prometheus.Registerer) *metrics {
|
||||
Subsystem: metricsSubSystem,
|
||||
Name: "ds_queries_total",
|
||||
Help: "Number of datasource queries made via server side expression requests",
|
||||
}, []string{"error", "dataplane"}),
|
||||
}, []string{"error", "dataplane", "datasource_type"}),
|
||||
|
||||
// older (No Namespace or Subsystem)
|
||||
expressionsQuerySummary: prometheus.NewSummaryVec(
|
||||
|
@ -81,7 +81,7 @@ func (m *MLNode) Execute(ctx context.Context, now time.Time, _ mathexp.Vars, s *
|
||||
}
|
||||
logger.Debug("Data source queried", "responseType", responseType)
|
||||
useDataplane := strings.HasPrefix("dataplane-", responseType)
|
||||
s.metrics.dsRequests.WithLabelValues(respStatus, fmt.Sprintf("%t", useDataplane)).Inc()
|
||||
s.metrics.dsRequests.WithLabelValues(respStatus, fmt.Sprintf("%t", useDataplane), mlPluginID).Inc()
|
||||
}()
|
||||
|
||||
// Execute the command and provide callback function for sending a request via plugin API.
|
||||
|
@ -235,7 +235,7 @@ func (dn *DSNode) Execute(ctx context.Context, now time.Time, _ mathexp.Vars, s
|
||||
}
|
||||
logger.Debug("Data source queried", "responseType", responseType)
|
||||
useDataplane := strings.HasPrefix(responseType, "dataplane-")
|
||||
s.metrics.dsRequests.WithLabelValues(respStatus, fmt.Sprintf("%t", useDataplane)).Inc()
|
||||
s.metrics.dsRequests.WithLabelValues(respStatus, fmt.Sprintf("%t", useDataplane), dn.datasource.Type).Inc()
|
||||
}()
|
||||
|
||||
resp, err := s.dataService.QueryData(ctx, req)
|
||||
|
Loading…
Reference in New Issue
Block a user