|
@@ -12,146 +12,240 @@ import (
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
"github.com/grafana/grafana/pkg/models"
|
|
|
"github.com/grafana/grafana/pkg/plugins"
|
|
"github.com/grafana/grafana/pkg/plugins"
|
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
"github.com/grafana/grafana/pkg/setting"
|
|
|
|
|
+ "github.com/prometheus/client_golang/prometheus"
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
var (
|
|
var (
|
|
|
- M_Instance_Start Counter
|
|
|
|
|
- M_Page_Status_200 Counter
|
|
|
|
|
- M_Page_Status_500 Counter
|
|
|
|
|
- M_Page_Status_404 Counter
|
|
|
|
|
- M_Page_Status_Unknown Counter
|
|
|
|
|
- M_Api_Status_200 Counter
|
|
|
|
|
- M_Api_Status_404 Counter
|
|
|
|
|
- M_Api_Status_500 Counter
|
|
|
|
|
- M_Api_Status_Unknown Counter
|
|
|
|
|
- M_Proxy_Status_200 Counter
|
|
|
|
|
- M_Proxy_Status_404 Counter
|
|
|
|
|
- M_Proxy_Status_500 Counter
|
|
|
|
|
- M_Proxy_Status_Unknown Counter
|
|
|
|
|
- M_Api_User_SignUpStarted Counter
|
|
|
|
|
- M_Api_User_SignUpCompleted Counter
|
|
|
|
|
- M_Api_User_SignUpInvite Counter
|
|
|
|
|
- M_Api_Dashboard_Save Timer
|
|
|
|
|
- M_Api_Dashboard_Get Timer
|
|
|
|
|
- M_Api_Dashboard_Search Timer
|
|
|
|
|
- M_Api_Admin_User_Create Counter
|
|
|
|
|
- M_Api_Login_Post Counter
|
|
|
|
|
- M_Api_Login_OAuth Counter
|
|
|
|
|
- M_Api_Org_Create Counter
|
|
|
|
|
- M_Api_Dashboard_Snapshot_Create Counter
|
|
|
|
|
- M_Api_Dashboard_Snapshot_External Counter
|
|
|
|
|
- M_Api_Dashboard_Snapshot_Get Counter
|
|
|
|
|
- M_Models_Dashboard_Insert Counter
|
|
|
|
|
- M_Alerting_Result_State_Alerting Counter
|
|
|
|
|
- M_Alerting_Result_State_Ok Counter
|
|
|
|
|
- M_Alerting_Result_State_Paused Counter
|
|
|
|
|
- M_Alerting_Result_State_NoData Counter
|
|
|
|
|
- M_Alerting_Result_State_Pending Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Slack Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Email Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Webhook Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_DingDing Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_PagerDuty Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_LINE Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Victorops Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_OpsGenie Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Telegram Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Threema Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Sensu Counter
|
|
|
|
|
- M_Alerting_Notification_Sent_Pushover Counter
|
|
|
|
|
- M_Aws_CloudWatch_GetMetricStatistics Counter
|
|
|
|
|
- M_Aws_CloudWatch_ListMetrics Counter
|
|
|
|
|
- M_DB_DataSource_QueryById Counter
|
|
|
|
|
|
|
+ M_Instance_Start prometheus.Counter
|
|
|
|
|
+ M_Page_Status *prometheus.CounterVec
|
|
|
|
|
+ M_Api_Status *prometheus.CounterVec
|
|
|
|
|
+ M_Proxy_Status *prometheus.CounterVec
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_User_SignUpStarted prometheus.Counter
|
|
|
|
|
+ M_Api_User_SignUpCompleted prometheus.Counter
|
|
|
|
|
+ M_Api_User_SignUpInvite prometheus.Counter
|
|
|
|
|
+ M_Api_Dashboard_Save prometheus.Summary
|
|
|
|
|
+ M_Api_Dashboard_Get prometheus.Summary
|
|
|
|
|
+ M_Api_Dashboard_Search prometheus.Summary
|
|
|
|
|
+ M_Api_Admin_User_Create prometheus.Counter
|
|
|
|
|
+ M_Api_Login_Post prometheus.Counter
|
|
|
|
|
+ M_Api_Login_OAuth prometheus.Counter
|
|
|
|
|
+ M_Api_Org_Create prometheus.Counter
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Create prometheus.Counter
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_External prometheus.Counter
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Get prometheus.Counter
|
|
|
|
|
+ M_Api_Dashboard_Insert prometheus.Counter
|
|
|
|
|
+ M_Alerting_Result_State *prometheus.CounterVec
|
|
|
|
|
+ M_Alerting_Notification_Sent *prometheus.CounterVec
|
|
|
|
|
+ M_Aws_CloudWatch_GetMetricStatistics prometheus.Counter
|
|
|
|
|
+ M_Aws_CloudWatch_ListMetrics prometheus.Counter
|
|
|
|
|
+ M_DB_DataSource_QueryById prometheus.Counter
|
|
|
|
|
|
|
|
// Timers
|
|
// Timers
|
|
|
- M_DataSource_ProxyReq_Timer Timer
|
|
|
|
|
- M_Alerting_Execution_Time Timer
|
|
|
|
|
|
|
+ M_DataSource_ProxyReq_Timer prometheus.Summary
|
|
|
|
|
+ M_Alerting_Execution_Time prometheus.Summary
|
|
|
|
|
|
|
|
// StatTotals
|
|
// StatTotals
|
|
|
- M_Alerting_Active_Alerts Gauge
|
|
|
|
|
- M_StatTotal_Dashboards Gauge
|
|
|
|
|
- M_StatTotal_Users Gauge
|
|
|
|
|
- M_StatTotal_Orgs Gauge
|
|
|
|
|
- M_StatTotal_Playlists Gauge
|
|
|
|
|
|
|
+ M_Alerting_Active_Alerts prometheus.Gauge
|
|
|
|
|
+ M_StatTotal_Dashboards prometheus.Gauge
|
|
|
|
|
+ M_StatTotal_Users prometheus.Gauge
|
|
|
|
|
+ M_StatTotal_Orgs prometheus.Gauge
|
|
|
|
|
+ M_StatTotal_Playlists prometheus.Gauge
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-func initMetricVars(settings *MetricSettings) {
|
|
|
|
|
- M_Instance_Start = RegCounter("instance_start")
|
|
|
|
|
-
|
|
|
|
|
- M_Page_Status_200 = RegCounter("page.resp_status", "code", "200")
|
|
|
|
|
- M_Page_Status_500 = RegCounter("page.resp_status", "code", "500")
|
|
|
|
|
- M_Page_Status_404 = RegCounter("page.resp_status", "code", "404")
|
|
|
|
|
- M_Page_Status_Unknown = RegCounter("page.resp_status", "code", "unknown")
|
|
|
|
|
-
|
|
|
|
|
- M_Api_Status_200 = RegCounter("api.resp_status", "code", "200")
|
|
|
|
|
- M_Api_Status_404 = RegCounter("api.resp_status", "code", "404")
|
|
|
|
|
- M_Api_Status_500 = RegCounter("api.resp_status", "code", "500")
|
|
|
|
|
- M_Api_Status_Unknown = RegCounter("api.resp_status", "code", "unknown")
|
|
|
|
|
-
|
|
|
|
|
- M_Proxy_Status_200 = RegCounter("proxy.resp_status", "code", "200")
|
|
|
|
|
- M_Proxy_Status_404 = RegCounter("proxy.resp_status", "code", "404")
|
|
|
|
|
- M_Proxy_Status_500 = RegCounter("proxy.resp_status", "code", "500")
|
|
|
|
|
- M_Proxy_Status_Unknown = RegCounter("proxy.resp_status", "code", "unknown")
|
|
|
|
|
-
|
|
|
|
|
- M_Api_User_SignUpStarted = RegCounter("api.user.signup_started")
|
|
|
|
|
- M_Api_User_SignUpCompleted = RegCounter("api.user.signup_completed")
|
|
|
|
|
- M_Api_User_SignUpInvite = RegCounter("api.user.signup_invite")
|
|
|
|
|
-
|
|
|
|
|
- M_Api_Dashboard_Save = RegTimer("api.dashboard.save")
|
|
|
|
|
- M_Api_Dashboard_Get = RegTimer("api.dashboard.get")
|
|
|
|
|
- M_Api_Dashboard_Search = RegTimer("api.dashboard.search")
|
|
|
|
|
-
|
|
|
|
|
- M_Api_Admin_User_Create = RegCounter("api.admin.user_create")
|
|
|
|
|
- M_Api_Login_Post = RegCounter("api.login.post")
|
|
|
|
|
- M_Api_Login_OAuth = RegCounter("api.login.oauth")
|
|
|
|
|
- M_Api_Org_Create = RegCounter("api.org.create")
|
|
|
|
|
-
|
|
|
|
|
- M_Api_Dashboard_Snapshot_Create = RegCounter("api.dashboard_snapshot.create")
|
|
|
|
|
- M_Api_Dashboard_Snapshot_External = RegCounter("api.dashboard_snapshot.external")
|
|
|
|
|
- M_Api_Dashboard_Snapshot_Get = RegCounter("api.dashboard_snapshot.get")
|
|
|
|
|
-
|
|
|
|
|
- M_Models_Dashboard_Insert = RegCounter("models.dashboard.insert")
|
|
|
|
|
-
|
|
|
|
|
- M_Alerting_Result_State_Alerting = RegCounter("alerting.result", "state", "alerting")
|
|
|
|
|
- M_Alerting_Result_State_Ok = RegCounter("alerting.result", "state", "ok")
|
|
|
|
|
- M_Alerting_Result_State_Paused = RegCounter("alerting.result", "state", "paused")
|
|
|
|
|
- M_Alerting_Result_State_NoData = RegCounter("alerting.result", "state", "no_data")
|
|
|
|
|
- M_Alerting_Result_State_Pending = RegCounter("alerting.result", "state", "pending")
|
|
|
|
|
-
|
|
|
|
|
- M_Alerting_Notification_Sent_Slack = RegCounter("alerting.notifications_sent", "type", "slack")
|
|
|
|
|
- M_Alerting_Notification_Sent_Email = RegCounter("alerting.notifications_sent", "type", "email")
|
|
|
|
|
- M_Alerting_Notification_Sent_Webhook = RegCounter("alerting.notifications_sent", "type", "webhook")
|
|
|
|
|
- M_Alerting_Notification_Sent_DingDing = RegCounter("alerting.notifications_sent", "type", "dingding")
|
|
|
|
|
- M_Alerting_Notification_Sent_PagerDuty = RegCounter("alerting.notifications_sent", "type", "pagerduty")
|
|
|
|
|
- M_Alerting_Notification_Sent_Victorops = RegCounter("alerting.notifications_sent", "type", "victorops")
|
|
|
|
|
- M_Alerting_Notification_Sent_OpsGenie = RegCounter("alerting.notifications_sent", "type", "opsgenie")
|
|
|
|
|
- M_Alerting_Notification_Sent_Telegram = RegCounter("alerting.notifications_sent", "type", "telegram")
|
|
|
|
|
- M_Alerting_Notification_Sent_Threema = RegCounter("alerting.notifications_sent", "type", "threema")
|
|
|
|
|
- M_Alerting_Notification_Sent_Sensu = RegCounter("alerting.notifications_sent", "type", "sensu")
|
|
|
|
|
- M_Alerting_Notification_Sent_LINE = RegCounter("alerting.notifications_sent", "type", "LINE")
|
|
|
|
|
- M_Alerting_Notification_Sent_Pushover = RegCounter("alerting.notifications_sent", "type", "pushover")
|
|
|
|
|
-
|
|
|
|
|
- M_Aws_CloudWatch_GetMetricStatistics = RegCounter("aws.cloudwatch.get_metric_statistics")
|
|
|
|
|
- M_Aws_CloudWatch_ListMetrics = RegCounter("aws.cloudwatch.list_metrics")
|
|
|
|
|
-
|
|
|
|
|
- M_DB_DataSource_QueryById = RegCounter("db.datasource.query_by_id")
|
|
|
|
|
-
|
|
|
|
|
- // Timers
|
|
|
|
|
- M_DataSource_ProxyReq_Timer = RegTimer("api.dataproxy.request.all")
|
|
|
|
|
- M_Alerting_Execution_Time = RegTimer("alerting.execution_time")
|
|
|
|
|
|
|
+func init() {
|
|
|
|
|
+ M_Instance_Start = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "instance_start_total",
|
|
|
|
|
+ Help: "counter for started instances",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Page_Status = prometheus.NewCounterVec(
|
|
|
|
|
+ prometheus.CounterOpts{
|
|
|
|
|
+ Name: "page_response_status_total",
|
|
|
|
|
+ Help: "page http response status",
|
|
|
|
|
+ },
|
|
|
|
|
+ []string{"code"},
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Status = prometheus.NewCounterVec(
|
|
|
|
|
+ prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_response_status_total",
|
|
|
|
|
+ Help: "api http response status",
|
|
|
|
|
+ },
|
|
|
|
|
+ []string{"code"},
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ M_Proxy_Status = prometheus.NewCounterVec(
|
|
|
|
|
+ prometheus.CounterOpts{
|
|
|
|
|
+ Name: "proxy_response_status_total",
|
|
|
|
|
+ Help: "proxy http response status",
|
|
|
|
|
+ },
|
|
|
|
|
+ []string{"code"},
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_User_SignUpStarted = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_user_signup_started_total",
|
|
|
|
|
+ Help: "amount of users who started the signup flow",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_User_SignUpCompleted = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_user_signup_completed_total",
|
|
|
|
|
+ Help: "amount of users who completed the signup flow",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_User_SignUpInvite = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_user_signup_invite_total",
|
|
|
|
|
+ Help: "amount of users who have been invited",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Save = prometheus.NewSummary(prometheus.SummaryOpts{
|
|
|
|
|
+ Name: "api_dashboard_save",
|
|
|
|
|
+ Help: "summary for dashboard save duration",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Get = prometheus.NewSummary(prometheus.SummaryOpts{
|
|
|
|
|
+ Name: "api_dashboard_get",
|
|
|
|
|
+ Help: "summary for dashboard get duration",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Search = prometheus.NewSummary(prometheus.SummaryOpts{
|
|
|
|
|
+ Name: "api_dashboard_search",
|
|
|
|
|
+ Help: "summary for dashboard search duration",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Admin_User_Create = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_admin_user_created_total",
|
|
|
|
|
+ Help: "api admin user created counter",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Api_Login_Post = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_login_post_total",
|
|
|
|
|
+ Help: "api login post counter",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Api_Login_OAuth = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_login_oauth_total",
|
|
|
|
|
+ Help: "api login oauth counter",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Api_Org_Create = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_org_create_total",
|
|
|
|
|
+ Help: "api org created counter",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Create = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_dashboard_snapshot_create_total",
|
|
|
|
|
+ Help: "dashboard snapshots created",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_External = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_dashboard_snapshot_external_total",
|
|
|
|
|
+ Help: "external dashboard snapshots created",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Get = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_dashboard_snapshot_get_total",
|
|
|
|
|
+ Help: "loaded dashboards",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Api_Dashboard_Insert = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "api_models_dashboard_insert_total",
|
|
|
|
|
+ Help: "dashboards inserted ",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Alerting_Result_State = prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "alerting_result_total",
|
|
|
|
|
+ Help: "alert execution result counter",
|
|
|
|
|
+ }, []string{"state"})
|
|
|
|
|
+
|
|
|
|
|
+ M_Alerting_Notification_Sent = prometheus.NewCounterVec(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "alerting_notification_sent_total",
|
|
|
|
|
+ Help: "counter for how many alert notifications been sent",
|
|
|
|
|
+ }, []string{"type"})
|
|
|
|
|
+
|
|
|
|
|
+ M_Aws_CloudWatch_GetMetricStatistics = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "aws_cloudwatch_get_metric_statistics_total",
|
|
|
|
|
+ Help: "counter for getting metric statistics from aws",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Aws_CloudWatch_ListMetrics = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "aws_cloudwatch_list_metrics_total",
|
|
|
|
|
+ Help: "counter for getting list of metrics from aws",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_DB_DataSource_QueryById = prometheus.NewCounter(prometheus.CounterOpts{
|
|
|
|
|
+ Name: "db_datasource_query_by_id_total",
|
|
|
|
|
+ Help: "counter for getting datasource by id",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_DataSource_ProxyReq_Timer = prometheus.NewSummary(prometheus.SummaryOpts{
|
|
|
|
|
+ Name: "api_dataproxy_request_all",
|
|
|
|
|
+ Help: "summary for dashboard search duration",
|
|
|
|
|
+ })
|
|
|
|
|
+ M_Alerting_Execution_Time = prometheus.NewSummary(prometheus.SummaryOpts{
|
|
|
|
|
+ Name: "alerting_execution_time_seconds",
|
|
|
|
|
+ Help: "summary of alert exeuction duration",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_Alerting_Active_Alerts = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
|
|
|
+ Name: "alerting_active_alerts",
|
|
|
|
|
+ Help: "amount of active alerts",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_StatTotal_Dashboards = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
|
|
|
+ Name: "stat_totals_dashboard",
|
|
|
|
|
+ Help: "total amount of dashboards",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_StatTotal_Users = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
|
|
|
+ Name: "stat_total_users",
|
|
|
|
|
+ Help: "total amount of users",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_StatTotal_Orgs = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
|
|
|
+ Name: "stat_total_orgs",
|
|
|
|
|
+ Help: "total amount of orgs",
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ M_StatTotal_Playlists = prometheus.NewGauge(prometheus.GaugeOpts{
|
|
|
|
|
+ Name: "stat_total_playlists",
|
|
|
|
|
+ Help: "total amount of playlists",
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
|
|
|
- // StatTotals
|
|
|
|
|
- M_Alerting_Active_Alerts = RegGauge("alerting.active_alerts")
|
|
|
|
|
- M_StatTotal_Dashboards = RegGauge("stat_totals", "stat", "dashboards")
|
|
|
|
|
- M_StatTotal_Users = RegGauge("stat_totals", "stat", "users")
|
|
|
|
|
- M_StatTotal_Orgs = RegGauge("stat_totals", "stat", "orgs")
|
|
|
|
|
- M_StatTotal_Playlists = RegGauge("stat_totals", "stat", "playlists")
|
|
|
|
|
|
|
+func initMetricVars(settings *MetricSettings) {
|
|
|
|
|
+ prometheus.MustRegister(
|
|
|
|
|
+ M_Instance_Start,
|
|
|
|
|
+ M_Page_Status,
|
|
|
|
|
+ M_Api_Status,
|
|
|
|
|
+ M_Api_User_SignUpStarted,
|
|
|
|
|
+ M_Api_User_SignUpCompleted,
|
|
|
|
|
+ M_Api_User_SignUpInvite,
|
|
|
|
|
+ M_Api_Dashboard_Save,
|
|
|
|
|
+ M_Api_Dashboard_Get,
|
|
|
|
|
+ M_Api_Dashboard_Search,
|
|
|
|
|
+ M_DataSource_ProxyReq_Timer,
|
|
|
|
|
+ M_Alerting_Execution_Time,
|
|
|
|
|
+ M_Api_Admin_User_Create,
|
|
|
|
|
+ M_Api_Login_Post,
|
|
|
|
|
+ M_Api_Login_OAuth,
|
|
|
|
|
+ M_Api_Org_Create,
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Create,
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_External,
|
|
|
|
|
+ M_Api_Dashboard_Snapshot_Get,
|
|
|
|
|
+ M_Api_Dashboard_Insert,
|
|
|
|
|
+ M_Alerting_Result_State,
|
|
|
|
|
+ M_Alerting_Notification_Sent,
|
|
|
|
|
+ M_Aws_CloudWatch_GetMetricStatistics,
|
|
|
|
|
+ M_Aws_CloudWatch_ListMetrics,
|
|
|
|
|
+ M_DB_DataSource_QueryById,
|
|
|
|
|
+ M_Alerting_Active_Alerts,
|
|
|
|
|
+ M_StatTotal_Dashboards,
|
|
|
|
|
+ M_StatTotal_Users,
|
|
|
|
|
+ M_StatTotal_Orgs,
|
|
|
|
|
+ M_StatTotal_Playlists)
|
|
|
|
|
|
|
|
go instrumentationLoop(settings)
|
|
go instrumentationLoop(settings)
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
func instrumentationLoop(settings *MetricSettings) chan struct{} {
|
|
func instrumentationLoop(settings *MetricSettings) chan struct{} {
|
|
|
- M_Instance_Start.Inc(1)
|
|
|
|
|
|
|
+ M_Instance_Start.Inc()
|
|
|
|
|
|
|
|
onceEveryDayTick := time.NewTicker(time.Hour * 24)
|
|
onceEveryDayTick := time.NewTicker(time.Hour * 24)
|
|
|
secondTicker := time.NewTicker(time.Second * time.Duration(settings.IntervalSeconds))
|
|
secondTicker := time.NewTicker(time.Second * time.Duration(settings.IntervalSeconds))
|
|
@@ -177,10 +271,10 @@ func updateTotalStats() {
|
|
|
return
|
|
return
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- M_StatTotal_Dashboards.Update(statsQuery.Result.Dashboards)
|
|
|
|
|
- M_StatTotal_Users.Update(statsQuery.Result.Users)
|
|
|
|
|
- M_StatTotal_Playlists.Update(statsQuery.Result.Playlists)
|
|
|
|
|
- M_StatTotal_Orgs.Update(statsQuery.Result.Orgs)
|
|
|
|
|
|
|
+ M_StatTotal_Dashboards.Set(float64(statsQuery.Result.Dashboards))
|
|
|
|
|
+ M_StatTotal_Users.Set(float64(statsQuery.Result.Users))
|
|
|
|
|
+ M_StatTotal_Playlists.Set(float64(statsQuery.Result.Playlists))
|
|
|
|
|
+ M_StatTotal_Orgs.Set(float64(statsQuery.Result.Orgs))
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|