Commit 28230bbf by Mark Carey Committed by GitHub

Metrics: Adds back missing summary quantiles (#21858)

Adds back missing summary quantiles which was mistakenly
removed in v6.6.0. 

Fixes #21857
parent 140e2676
...@@ -154,6 +154,8 @@ var ( ...@@ -154,6 +154,8 @@ var (
func init() { func init() {
httpStatusCodes := []string{"200", "404", "500", "unknown"} httpStatusCodes := []string{"200", "404", "500", "unknown"}
objectiveMap := map[float64]float64{0.5: 0.05, 0.9: 0.01, 0.99: 0.001}
MInstanceStart = prometheus.NewCounter(prometheus.CounterOpts{ MInstanceStart = prometheus.NewCounter(prometheus.CounterOpts{
Name: "instance_start_total", Name: "instance_start_total",
Help: "counter for started instances", Help: "counter for started instances",
...@@ -191,8 +193,9 @@ func init() { ...@@ -191,8 +193,9 @@ func init() {
MHttpRequestSummary = prometheus.NewSummaryVec( MHttpRequestSummary = prometheus.NewSummaryVec(
prometheus.SummaryOpts{ prometheus.SummaryOpts{
Name: "http_request_duration_milliseconds", Name: "http_request_duration_milliseconds",
Help: "http request summary", Help: "http request summary",
Objectives: objectiveMap,
}, },
[]string{"handler", "statuscode", "method"}, []string{"handler", "statuscode", "method"},
) )
...@@ -216,21 +219,24 @@ func init() { ...@@ -216,21 +219,24 @@ func init() {
}) })
MApiDashboardSave = prometheus.NewSummary(prometheus.SummaryOpts{ MApiDashboardSave = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "api_dashboard_save_milliseconds", Name: "api_dashboard_save_milliseconds",
Help: "summary for dashboard save duration", Help: "summary for dashboard save duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MApiDashboardGet = prometheus.NewSummary(prometheus.SummaryOpts{ MApiDashboardGet = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "api_dashboard_get_milliseconds", Name: "api_dashboard_get_milliseconds",
Help: "summary for dashboard get duration", Help: "summary for dashboard get duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MApiDashboardSearch = prometheus.NewSummary(prometheus.SummaryOpts{ MApiDashboardSearch = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "api_dashboard_search_milliseconds", Name: "api_dashboard_search_milliseconds",
Help: "summary for dashboard search duration", Help: "summary for dashboard search duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MApiAdminUserCreate = newCounterStartingAtZero(prometheus.CounterOpts{ MApiAdminUserCreate = newCounterStartingAtZero(prometheus.CounterOpts{
...@@ -330,21 +336,24 @@ func init() { ...@@ -330,21 +336,24 @@ func init() {
}) })
LDAPUsersSyncExecutionTime = prometheus.NewSummary(prometheus.SummaryOpts{ LDAPUsersSyncExecutionTime = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "ldap_users_sync_execution_time", Name: "ldap_users_sync_execution_time",
Help: "summary for LDAP users sync execution duration", Help: "summary for LDAP users sync execution duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MDataSourceProxyReqTimer = prometheus.NewSummary(prometheus.SummaryOpts{ MDataSourceProxyReqTimer = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "api_dataproxy_request_all_milliseconds", Name: "api_dataproxy_request_all_milliseconds",
Help: "summary for dataproxy request duration", Help: "summary for dataproxy request duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MAlertingExecutionTime = prometheus.NewSummary(prometheus.SummaryOpts{ MAlertingExecutionTime = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "alerting_execution_time_milliseconds", Name: "alerting_execution_time_milliseconds",
Help: "summary of alert exeuction duration", Help: "summary of alert exeuction duration",
Namespace: exporterName, Objectives: objectiveMap,
Namespace: exporterName,
}) })
MAlertingActiveAlerts = prometheus.NewGauge(prometheus.GaugeOpts{ MAlertingActiveAlerts = prometheus.NewGauge(prometheus.GaugeOpts{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment