Closed jayme-github closed 8 months ago
LGTM! Thank you @jayme-github !
Sample metrics for reference:
# HELP rsyslog_omkafka_errors msg_too_large: failed to deliver to the broker because broker considers message to be too large. Note that omkafka may still resubmit to librdkafka depending on resubmitOnFailure option; unknown_topic: failed to deliver to the broker because broker does not recognize the topic; queue_full: dropped by librdkafka when its queue becomes full. Note that default size of librdkafka queue is 100,000 messages; unknown_partition: failed to deliver because broker does not recognize a partition; other: all of the rest of the failures that do not fall in any of the other failure categories
# TYPE rsyslog_omkafka_errors counter
rsyslog_omkafka_errors{type="auth"} 0
rsyslog_omkafka_errors{type="broker_down"} 0
rsyslog_omkafka_errors{type="other"} 0
rsyslog_omkafka_errors{type="ssl"} 0
rsyslog_omkafka_errors{type="timed_out"} 0
rsyslog_omkafka_errors{type="transport"} 0
# HELP rsyslog_omkafka_failures msg_too_large: failed to deliver to the broker because broker considers message to be too large. Note that omkafka may still resubmit to librdkafka depending on resubmitOnFailure option; unknown_topic: failed to deliver to the broker because broker does not recognize the topic; queue_full: dropped by librdkafka when its queue becomes full. Note that default size of librdkafka queue is 100,000 messages; unknown_partition: failed to deliver because broker does not recognize a partition; other: all of the rest of the failures that do not fall in any of the other failure categories
# TYPE rsyslog_omkafka_failures counter
rsyslog_omkafka_failures{type="msg_too_large"} 0
rsyslog_omkafka_failures{type="other"} 0
rsyslog_omkafka_failures{type="queue_full"} 0
rsyslog_omkafka_failures{type="unknown_partition"} 0
rsyslog_omkafka_failures{type="unknown_topic"} 0
# HELP rsyslog_omkafka_int_latency_avg_usec_avg internal librdkafka producer queue latency in microseconds averaged other all brokers. This is also part of window statistics and average excludes brokers with zero internal latency
# TYPE rsyslog_omkafka_int_latency_avg_usec_avg gauge
rsyslog_omkafka_int_latency_avg_usec_avg 0
# HELP rsyslog_omkafka_maxoutqsize high water mark of output queue size
# TYPE rsyslog_omkafka_maxoutqsize counter
rsyslog_omkafka_maxoutqsize 0
# HELP rsyslog_omkafka_messages number of messages: submitted: messages submitted to omkafka for processing (with both acknowledged deliveries to broker as well as failed or re-submitted from omkafka to librdkafka); failures: messages that librdkafka failed to deliver (broken down into various types in omkafka_failures); acked: messages that were acknowledged by kafka broker. Note that kafka broker provides two levels of delivery acknowledgements depending on topicConfParam: default (acks=1) implies delivery to the leader only while acks=-1 implies delivery to leader as well as replication to all brokers
# TYPE rsyslog_omkafka_messages counter
rsyslog_omkafka_messages{type="acked"} 0
rsyslog_omkafka_messages{type="failures"} 0
rsyslog_omkafka_messages{type="submitted"} 0
# HELP rsyslog_omkafka_rtt_avg_usec_acg broker round trip time in microseconds averaged over all brokers. It is based on the statistics callback window specified through statistics.interval.ms parameter to librdkafka. Average exclude brokers with less than 100 microseconds rtt
# TYPE rsyslog_omkafka_rtt_avg_usec_acg gauge
rsyslog_omkafka_rtt_avg_usec_acg 0
# HELP rsyslog_omkafka_throttle_avg_msec_avg broker throttling time in milliseconds averaged over all brokers. This is also a part of window statistics delivered by librdkakfka. Average excludes brokers with zero throttling time
# TYPE rsyslog_omkafka_throttle_avg_msec_avg gauge
rsyslog_omkafka_throttle_avg_msec_avg 0
# HELP rsyslog_omkafka_topicdynacache skipped: dynamic topic cache lookups that find an existing topic and skip creating a new one; miss: dynamic topic cache lookups that fail to find an existing topic and end up creating new one; evicted: dynamic topic cache entry evictions
# TYPE rsyslog_omkafka_topicdynacache counter
rsyslog_omkafka_topicdynacache{type="evicted"} 0
rsyslog_omkafka_topicdynacache{type="miss"} 0
rsyslog_omkafka_topicdynacache{type="skipped"} 0
Thank your for your contribution. I'm merging this and I will make a new release.
Parse omkafka statistics according to https://www.rsyslog.com/doc/configuration/modules/omkafka.html#statistic-counter
cc @filippog