-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Description
Component(s)
No response
Is your feature request related to a problem? Please describe.
On multiple occasions, I have had the need to create custom metrics with the result of some (usually simple) commands or script execution.
An example would be:
- attacking an endpoint of an api to get a value and convert it to metric.
- check the status of a service with systemctl etc.
As a solution I have been delegating the execution of these simple commands in linux timers and services that execute the commands and then send the result by OTLP to the collector.
But in my opinion, I think the ideal would be to be able to include these executions inside the collector itself with some kind of receiver.
Describe the solution you'd like
My idea is a receiver similar to the sqlqueryreceiver.
In it will be configured:
- the command to execute
- the name of the metric
- the resource attributes to be included in the metric
- execution interval (default 1m)
- timeout (default 5s)
In influxdata (telegraf) I think there is already something like what I am proposing: https://github.com/influxdata/telegraf/blob/master/plugins/inputs/exec/README.md
Describe alternatives you've considered
The only alternative to this I can think of is what I'm already doing....
Instead of delegating the execution to the collector itself, perform it externally in sending the metrics by OTLP.
Additional context
Has something similar been considered in the past and discarded for any reason?