Hi,
I have a Graylog in claster. One master and one slave.
I’d like to know the API to have the in/out throughput to show on another view.
Using GET /system/metrics/{metricName} or [GET] /cluster/{nodeId}/metrics/namespace/{namespace} with org.graylog2.throughput.input.1-sec-rate and org.graylog2.throughput.output.1-sec-rate I always have the 0 result
Where am I doing wrong?
Is there the possibility to have a specific output throughput metric?
I need to know how many messages are going to Kafka. Adding the Kafka Output, How can I understand how many events are actually sent to?
Are you sure that you do not have a typo somewhere? Using copy/paste into postman with your URLs (and replacing the {nodeId} and {metricName} respectively, I get correct results: Using /cluster/{nodeId}/...
This returns the requested metrics for each system in your cluster, removing the need to adapt your code if you ever expand your cluster. Example response:
Sadly, I think not (yet)! Every input Graylog has is providing metrics (idk about plugin inputs, but my guess would be, that Graylog applies at least a basic metric set on these), since you can see detailed stats on the System → Inputs page. The System → Outputs page is a lot more sparse, which already hints that there are no metrics for outputs.
Hi @derPhlipsi
thank you so much for the detailed answer.
My concern was caused by the fact that I always value 0 as an answer.
I execute the test on the Grayog swagger view. Now everything is more clear!
You could do two things: You could either implement your own plugin that adds a output that is reporting metrics via the dropwizard metics library that Graylog is using. These metrics are automatically made available through the Graylog API if you use the metric registry Graylog provides.
The other option would be to fork the Graylog server project, implement a basic set of metrics on the general output classes (similar to the generic input classes, basically a clever copy/paste job) and submit a Pull request. Disclaimer: I did not look further into the source code since I do not have time for that atm, so any statement about “being easy” is to be seen as limited warranty