Commit 09eb9a45 by Oleg Gaidarenko Committed by GitHub

Metrics: add LDAP active sync summary metric (#18079)

parent 7213e1f7
......@@ -269,7 +269,8 @@ func (hs *HTTPServer) metricsEndpoint(ctx *macaron.Context) {
return
}
promhttp.HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}).
promhttp.
HandlerFor(prometheus.DefaultGatherer, promhttp.HandlerOpts{}).
ServeHTTP(ctx.Resp, ctx.Req.Request)
}
......
......@@ -40,6 +40,10 @@ var (
M_Aws_CloudWatch_GetMetricData prometheus.Counter
M_DB_DataSource_QueryById prometheus.Counter
// LDAPUsersSyncExecutionTime is a metric for
// how much time it took to sync the LDAP users
LDAPUsersSyncExecutionTime prometheus.Summary
// Timers
M_DataSource_ProxyReq_Timer prometheus.Summary
M_Alerting_Execution_Time prometheus.Summary
......@@ -235,6 +239,12 @@ func init() {
Namespace: exporterName,
})
LDAPUsersSyncExecutionTime = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "ldap_users_sync_execution_time",
Help: "summary for LDAP users sync execution duration",
Namespace: exporterName,
})
M_DataSource_ProxyReq_Timer = prometheus.NewSummary(prometheus.SummaryOpts{
Name: "api_dataproxy_request_all_milliseconds",
Help: "summary for dataproxy request duration",
......@@ -377,6 +387,7 @@ func initMetricVars() {
M_Aws_CloudWatch_ListMetrics,
M_Aws_CloudWatch_GetMetricData,
M_DB_DataSource_QueryById,
LDAPUsersSyncExecutionTime,
M_Alerting_Active_Alerts,
M_StatTotal_Dashboards,
M_StatTotal_Users,
......@@ -390,7 +401,8 @@ func initMetricVars() {
StatsTotalActiveViewers,
StatsTotalActiveEditors,
StatsTotalActiveAdmins,
grafanaBuildVersion)
grafanaBuildVersion,
)
}
......
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