-
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: logstash #11421
feat: logstash #11421
Conversation
The default JSON output looks like: { metrics: [ { … }, { … }, ], } Logstash receivers don't seem to work well with high volume of this and work better with [ { … }, { … }, ]
Hey @HeikoSchlittermann thanks for the PR! As this is actually not necessarily |
Hey @srebhan, sorry for the delayed response. I'll check how to do it, or - if you know already how to do it, feel free to change our PR or cherry-pick whatever you want (but please keep the author names if possible) |
@HeikoSchlittermann I don't think you need any code change here. Please try to use the json_transformation = "metrics" Can you please give it a try? This probably only works with master or a recent nightly build as #11251 didn't make it to a release yet... |
Hi @srebhan thanks for your feedback. I start testing your suggesting now. |
Hi @srebhan,
To avoid the error:
The config I used to test:
Was my change at the correct place? Or would you prefer to add "json_transformation" to one of the cases in |
@HeikoSchlittermann thanks for testing!
This is the wrong place as it would require all output plugins to add that option. In my PR #11251 I forgot to add the new option to the |
Haha, I had it there in the first place but was not sure if this is the correct one. Will prepare it that way. |
Thanks for your patience @srebhan Best regards |
I'm closing this PR (and remove the branches on our side), as with the advent of 1.24 our patch won't be necessary anymore (we're successfully using the current master branch). The Thanks to @srebhan and the Telegraf team for your development. |
In a large scale environment Telegraf sends data to Logstash instances. For some reason the Logstash receivers are not efficient in "unwrapping" the hash to get the
metrics
array.Our change provides a new config option "json_logstash_support". This option defaults to "false", so the behaviour of existing instances is not changed. Setting this option to "true" drops the outermost envelope and sends the data just as an array with all metrics.
logstash support off (the default):
{ metrics => [ m1, m2, m3, ... ] }
logstash support on :
[m1, m2, m3, ...]
This option is used in pre-production already and allows us more throughput when sending the metrics.