-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to export configurable set of topic configuration keys #97
Conversation
@@ -20,7 +20,6 @@ func (s *Service) GetTopicConfigs(ctx context.Context) (*kmsg.DescribeConfigsRes | |||
resourceReq := kmsg.NewDescribeConfigsRequestResource() | |||
resourceReq.ResourceType = kmsg.ConfigResourceTypeTopic | |||
resourceReq.ResourceName = topic.Topic | |||
resourceReq.ConfigNames = []string{"cleanup.policy"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is done to ensure all configurations are returned
Hey Adi, Basically making it configurable like this (and use a sane default there): topics:
# Granularity can be per topic or per partition. If you want to reduce the number of exported metric series and
# you aren't interested in per partition metrics you could choose "topic".
granularity: partition
# AllowedTopics are regex strings of topic names whose topic metrics that shall be exported.
# You can specify allowed topics by providing literals like "my-topic-name" or by providing regex expressions
# like "/internal-.*/".
allowedTopics: [ ".*" ]
# IgnoredTopics are regex strings of topic names that shall be ignored/skipped when exporting metrics. Ignored topics
# take precedence over allowed topics.
ignoredTopics: [ ]
# infoMetric is a configuration object for the kminion_kafka_topic_info metric
infoMetric:
# ConfigKeys are regex strings of Topic configs that you want to have exported as part of the metric
configKeys: ["max_message_bytes", "min_insync_replicas"] What do you think? |
makes a lot of sense, Martin! Will amend this PR to have these configurable. |
9e36bda
to
89ece71
Compare
Kowl is awesome indeed! |
@@ -55,7 +56,7 @@ func (e *Exporter) collectTopicInfo(ctx context.Context, ch chan<- prometheus.Me | |||
e.logger.Warn("failed to get metadata of a specific topic", | |||
zap.String("topic_name", topic.Topic), | |||
zap.Error(typedErr)) | |||
return false | |||
continue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
be lenient to individual topic failures
Updated the PR based on your suggestion @weeco |
Added a new configuration parameter to allow defining the set of topic configuration keys that should be exported as label pairs in kafka_topic_info By default only `cleanup.policy` configuration is exported See https://kafka.apache.org/documentation/#topicconfigs for the list of topic level configs that can be defined
7eb49d6
to
77249c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generally LGTM, added a few comments though 👍 .
Co-authored-by: Martin Schneppenheim <weeco91@gmail.com>
Co-authored-by: Martin Schneppenheim <weeco91@gmail.com>
Co-authored-by: Martin Schneppenheim <weeco91@gmail.com>
Added a new configuration parameter to allow defining the
set of topic configuration keys that should be exported as label pairs
in kafka_topic_info
By default only
cleanup.policy
configuration is exportedSee https://kafka.apache.org/documentation/#topicconfigs
for the list of topic level configs that can be defined