11 May 2022 03:10 AM - last edited on 18 May 2023 03:56 AM by Michal_Gebacki
I created a custom Prometheus ActiveGate plugin where we currently do a call to an endpoint to get a list of metrics. This is currently working and we now want to change it to do a call to the prometheus endpoint api based on a query.
In the extensions.yaml file you define the specific metrics you want to capture based on the list of metrics you get from calling the API or an endpoint. For testing purposes we did define two static metrics we wanted to capture to see if the integration did work:
dimensions: - key: go value: const:go metrics: - key: custom.extension.prometheus-go.global.go_threads value: metric:go_threads type: count - key: custom.extension.prometheus-go.global.go_memstats_sys_bytes value: metric:go_memstats_sys_bytes type: count
But now we want to scrape specific metrics or all metrics (since there are more than 300+) which are returned when executing the specific query call to the Prometheus API. Is there some way to dynamically do this and if so how?
Solved! Go to Solution.
No unfortunately not, as the metrics have to be defined during extension creation/setup.
You can only dynamically create dimensions for a metric, but even there the dimension has to be setup during extension creating and you can only add more instances of a dimension dynamically.