-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(serializers.prometheus): allow serializing metrics without HELP and TYPE metadata #11417
feat(serializers.prometheus): allow serializing metrics without HELP and TYPE metadata #11417
Conversation
2de70d3
to
c862eed
Compare
Download PR build artifacts for linux_amd64.tar.gz, darwin_amd64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
Hmmm, this seems a lot of code to just leave out two fields... This being said, the For the What do you think? |
@srebhan thanks for checking it out. The thing is I want to make the network footprint as small as possible. I'm trying to use the serializer with Kafka output and each message is like this:
It's 206 bytes long. Without a quick testI've done a more real-world example with real-time streaming to Kafka using zstd compression. It's 20 instances of Prometheus node-exporters scraped every 5sec by Telegraf: So in my test it's 25% more efficient with implementationYou're right I could easily remove I agree it'd be perfect to have the Eventually, I couldn't come up with a better solution than a custom encoder that just removes both |
@vpedosyuk I see your point and agree that it would be nice to remove the noise if that's still conforming to the spec, but I do not agree with your way of achieving it. :-) Bluntly copying large chunks of internal prometheus code to Telegraf will make us maintain that encoder and I'm pretty sure you are not going to sync back bug-fixes etc from prometheus to Telegraf, are you? This being said, the For the |
Hello! I am closing this issue due to inactivity. I hope you were able to resolve your problem, if not please try posting this question in our Community Slack or Community Page. Thank you! |
Required for all PRs:
resolves #11390
Added
prometheus_compact_encoding
option,false
by default. It's basically another Prometheus encoder which is mostly a copy of the standard lib implementation:https://github.com/prometheus/common/blob/main/expfmt/text_create.go
with the only difference in HELP and TYPE comments handling that are just skipped here.