Documentation
¶
Index ¶
- Variables
- func AddAPICall(controller string, req *http.Request, resp *http.Response, duration float64)
- func DeleteMetricPagerDutyIntegrationSecretLoaded(pdiName string) bool
- func SetReconcileDuration(controller string, duration float64)
- func UpdateAPIMetrics(APIKey string, timer *prometheus.Timer)
- func UpdateMetricPagerDutyCreateFailure(x int, cd string, pdiName string)
- func UpdateMetricPagerDutyDeleteFailure(x int, cd string, pdiName string)
- func UpdateMetricPagerDutyHeartbeat(APIKey string, timer *prometheus.Timer)
- func UpdateMetricPagerDutyIntegrationSecretLoaded(x int, pdiName string)
- func UpdateMetricPagerDutyServiceOrchestrationFailure(v int, pdiName string)
Constants ¶
This section is empty.
Variables ¶
var ( MetricPagerDutyCreateFailure = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "pagerduty_create_failure", Help: "Metric for the failure of creating a cluster deployment.", ConstLabels: prometheus.Labels{"name": "pagerduty-operator"}, }, []string{"clusterdeployment_name", "pagerdutyintegration_name"}) MetricPagerDutyDeleteFailure = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "pagerduty_delete_failure", Help: "Metric for the failure of deleting a cluster deployment.", ConstLabels: prometheus.Labels{"name": "pagerduty-operator"}, }, []string{"clusterdeployment_name", "pagerdutyintegration_name"}) MetricPagerDutyHeartbeat = prometheus.NewSummary(prometheus.SummaryOpts{ Name: "pagerduty_heartbeat", Help: "Metric for heartbeating of the Pager Duty api.", ConstLabels: prometheus.Labels{"name": "pagerduty-operator"}, }) ReconcileDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: "pagerduty_operator_reconcile_duration_seconds", Help: "Distribution of the number of seconds a Reconcile takes, broken down by controller", ConstLabels: prometheus.Labels{"name": "pagerduty-operator"}, Buckets: []float64{0.001, 0.01, 0.1, 1, 5, 10, 20}, }, []string{"controller"}) // apiCallDuration times API requests. Histogram also gives us a _count metric for free. ApiCallDuration = prometheus.NewHistogramVec(prometheus.HistogramOpts{ Name: "pagerduty_operator_api_request_duration_seconds", Help: "Distribution of the number of seconds an API request takes", ConstLabels: prometheus.Labels{"name": operatorName}, Buckets: []float64{1}, }, []string{"controller", "method", "resource", "status"}) MetricPagerDutyIntegrationSecretLoaded = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "pagerdutyintegration_secret_loaded", Help: "Metric to track the ability to load the PagerDuty API key from the Secret specified in the PagerDutyIntegration", ConstLabels: prometheus.Labels{"name": "pagerduty-operator"}, }, []string{"pagerdutyintegration_name"}) MetricPagerDutyServiceOrchestrationFailure = prometheus.NewGaugeVec(prometheus.GaugeOpts{ Name: "pagerduty_service_orchestration_failure", Help: "Metric to indicate that the service orchestration config is failed on the managed clusters when it is enabled in PagerDutyIntegration", ConstLabels: prometheus.Labels{"name": operatorName}, }, []string{"pagerdutyintegration_name"}) MetricsList = []prometheus.Collector{ MetricPagerDutyCreateFailure, MetricPagerDutyDeleteFailure, MetricPagerDutyHeartbeat, ApiCallDuration, ReconcileDuration, MetricPagerDutyIntegrationSecretLoaded, MetricPagerDutyServiceOrchestrationFailure, } )
Functions ¶
func AddAPICall ¶
AddAPICall observes metrics for a call to an external API - param controller: The name of the controller making the API call - param req: The HTTP Request structure - param resp: The HTTP Response structure - param duration: The number of seconds the call took.
func DeleteMetricPagerDutyIntegrationSecretLoaded ¶
DeleteMetricPagerDutyIntegrationSecretLoaded deletes the metric for the PagerDutyIntegration name provided. This should be called when e.g. the PagerDutyIntegration is being deleted, so that there are no irrelevant metrics (which alerts could be firing on).
func SetReconcileDuration ¶
SetReconcileDuration Push the duration of the reconcile iteration
func UpdateAPIMetrics ¶
func UpdateAPIMetrics(APIKey string, timer *prometheus.Timer)
UpdateAPIMetrics updates all API endpoint metrics every 5 minutes
func UpdateMetricPagerDutyCreateFailure ¶
UpdateMetricPagerDutyCreateFailure updates gauge to 1 when creation fails
func UpdateMetricPagerDutyDeleteFailure ¶
UpdateMetricPagerDutyDeleteFailure updates gauge to 1 when deletion fails
func UpdateMetricPagerDutyHeartbeat ¶
func UpdateMetricPagerDutyHeartbeat(APIKey string, timer *prometheus.Timer)
UpdateMetricPagerDutyHeartbeat curls the PD API, updates the gauge to 1 when successful.
func UpdateMetricPagerDutyIntegrationSecretLoaded ¶
UpdateMetricPagerDutyIntegrationSecretLoaded updates gauge to 1 when the PagerDuty API key can be loaded from the Secret specified in the PagerDutyIntegration, or to 0 if it fails
func UpdateMetricPagerDutyServiceOrchestrationFailure ¶
UpdateMetricPagerDutyServiceOrchestrationFailure updates the gauge value when service orchestration configure fails
Types ¶
This section is empty.