You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment the Pod collector only supports JSONPath, which means that the underlying metrics need to be "processed" and the data cannot be parsed in any way before making it available as a metric.
The underlying ajson library has a scripting engine that makes this feature possible without having to substantial lifting. Is this something you would be interested in supporting? I have a working POC here.
I skip JSONPath validation as that short circuits scripts and run the expression through ajson.Eval when ajson.Node.JSONPath fails. ajson's CLI works in a similar way.
We could have a different syntax too, metric-config.pods.<metricName>.json-path/json-eval maybe, where JSONPath validation is kept and only one of them can be used at a time.
An example of the kind of expression this allows is:
At the moment the Pod collector only supports
JSONPath
, which means that the underlying metrics need to be "processed" and the data cannot be parsed in any way before making it available as a metric.The underlying ajson library has a scripting engine that makes this feature possible without having to substantial lifting. Is this something you would be interested in supporting? I have a working POC here.
I skip
JSONPath
validation as that short circuits scripts and run the expression throughajson.Eval
whenajson.Node.JSONPath
fails. ajson's CLI works in a similar way.We could have a different syntax too,
metric-config.pods.<metricName>.json-path/json-eval
maybe, where JSONPath validation is kept and only one of them can be used at a time.An example of the kind of expression this allows is:
This returns the used worker percent for php-fpm calculated from the status endpoint that returns a JSON document like this:
The text was updated successfully, but these errors were encountered: