Documentation ¶
Overview ¶
Package metrics contains all metrics that needs to be exposed to Prometheus and indirectly to Grafana. Currently, the following metrics are exposed:
consumed_messages - total number of messages consumed from selected broker
consuming_errors - total number of errors during consuming messages from selected broker
messages_with_empty_rule_execution_result - total number of consumed messages not processed as rule execution result is an empty report
successful_messages_processing_time - time to process successfully message
failed_messages_processing_time - time to process message fail
last_checked_timestamp_lag_minutes - shows how slow we get messages from clusters
produced_messages - total number of produced messages sent to Payload Tracker's Kafka topic
written_reports - total number of reports written into the storage (cache)
feedback_on_rules - total number of left feedback
sql_queries_counter - total number of SQL queries
sql_queries_durations - SQL queries durations
sql_recommendations_updates - number of insert and deletes in recommendations table
Index ¶
Constants ¶
This section is empty.
Variables ¶
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 sent to Payload Tracker's Kafka topic",
})
ProducedMessages shows number of messages produced by producer package probably it will be used only in tests
var RatingOnRules = promauto.NewCounter(prometheus.CounterOpts{
Name: "rating_on_rules",
Help: "The total number of left rating",
})
RatingOnRules shows how many times users sends a rating on rules
var SQLQueriesCounter = promauto.NewCounter(prometheus.CounterOpts{
Name: "sql_queries_counter",
Help: "Number of SQL queries",
})
SQLQueriesCounter shows number of sql queries
var SQLQueriesDurations = promauto.NewHistogramVec(prometheus.HistogramOpts{ Name: "sql_queries_durations", Help: "SQL queries durations", }, []string{"query"})
SQLQueriesDurations shows durations for sql queries (without parameters).
var SkippedEmptyReports = promauto.NewCounter(prometheus.CounterOpts{
Name: "messages_with_empty_rule_execution_result",
Help: "The total number of consumed messages not processed as the rule execution resulted in an empty report",
})
SkippedEmptyReports shows the total number of consumed messages not processed as the rule execution resulted in an empty report
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 ¶
func AddMetricsWithNamespace ¶ added in v1.1.0
func AddMetricsWithNamespace(namespace string)
AddMetricsWithNamespace register the desired metrics using a given namespace
Types ¶
This section is empty.