Documentation ¶
Overview ¶
Package metrics contains all metrics that needs to be exposed to Prometheus and indirectly to Grafana. Currently, the following metrics are exposed:
api_endpoints_requests - number of requests made for each REST API endpoint
api_endpoints_response_time - response times for all REST API endpoints
consumed_messages - total number of messages consumed from selected broker
produced_messages - total number of produced messages
written_reports - total number of reports written into the storage (cache)
Generated documentation is available at: https://godoc.org/github.com/RedHatInsights/insights-results-aggregator-mock/metrics
Documentation in literate-programming-style is available at: https://redhatinsights.github.io/insights-results-aggregator-mock/packages/metrics/metrics.html
Index ¶
Constants ¶
This section is empty.
Variables ¶
var APIRequests = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "api_endpoints_requests", Help: "The total number of requests per endpoint", }, []string{"endpoint"})
APIRequests is a counter vector for requests to endpoints
var APIResponseStatusCodes = promauto.NewCounterVec(prometheus.CounterOpts{ Name: "api_endpoints_status_codes", Help: "API endpoints status codes", }, []string{"status_code"})
APIResponseStatusCodes collects the information about api response status codes
var APIResponsesTime = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "api_endpoints_response_time", Help: "API endpoints response time", Buckets: prometheus.LinearBuckets(0, 20, 20), }, []string{"endpoint"})
APIResponsesTime collects the information about api response time per endpoint
var ConsumedMessages = promauto.NewCounter(prometheus.CounterOpts{
Name: "consumed_messages",
Help: "The total number of messages consumed from Kafka",
})
ConsumedMessages shows number of messages consumed from Kafka by aggregator
var ConsumingErrors = promauto.NewCounter(prometheus.CounterOpts{
Name: "consuming_errors",
Help: "The total number of errors during consuming messages from Kafka",
})
ConsumingErrors shows the total number of errors during consuming messages from Kafka
var FailedMessagesProcessingTime = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "failed_messages_processing_time",
Help: "Time to process message fail",
})
FailedMessagesProcessingTime collects the time of processing message when it failed
var FeedbackOnRules = promauto.NewCounter(prometheus.CounterOpts{
Name: "feedback_on_rules",
Help: "The total number of left feedback",
})
FeedbackOnRules shows how many times users left feedback on rules
var LastCheckedTimestampLagMinutes = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "last_checked_timestamp_lag_minutes",
Help: "Shows how slow we get messages from clusters",
})
LastCheckedTimestampLagMinutes shows how slow we get messages from clusters
var ProducedMessages = promauto.NewCounter(prometheus.CounterOpts{
Name: "produced_messages",
Help: "The total number of produced messages",
})
ProducedMessages shows number of messages produced by producer package probably it will be used only in tests
var SuccessfulMessagesProcessingTime = promauto.NewHistogram(prometheus.HistogramOpts{
Name: "successful_messages_processing_time",
Help: "Time to process successfully message",
})
SuccessfulMessagesProcessingTime collects the time to process message successfully
var WrittenReports = promauto.NewCounter(prometheus.CounterOpts{
Name: "written_reports",
Help: "The total number of reports written to the storage",
})
WrittenReports shows number of reports written into the database
Functions ¶
This section is empty.
Types ¶
This section is empty.