Grafana Custom Query #583
-
Hi, I opened a support ticket for Grafana because I need some custom metrics from a database. They said it would be a bug, I'm not sure about that. I configured an exporter.mssql in the alloy.config file and in a mssqlqueries.yml file I added some metrics (not the ones I need, just a test as stated in the documentation https://grafana.com/docs/alloy/latest/reference/components/prometheus/prometheus.exporter.mssql/#custom-metrics). The Alloy service starts normally and does not show any errors but the metric does not appear. Any tips? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi @fellipedemoraes, It's not a bug for sure, it's the way Grafana Alloy handles the configuration. I was recently on a call with Grafana's customer. We found out that you also need to whitelist the custom metrics in the config. Usually it's somewhere in the rules where the regex and action is configured (just follow the pipeline). Otherwise the metric is just being filtered out (and hence there's no error nor data). Once you added the custom metrics name to the regex, it should appear. Please have a look, and let me know if you still have an issue. I'm happy to assist, but it's an issue on the alloy/agent config. 👍 |
Beta Was this translation helpful? Give feedback.
-
Hi, Thanks for your help, I'll post the solution here for anyone else who may have difficulty creating a custom query with alloy/prometheus. BR |
Beta Was this translation helpful? Give feedback.
Hi @fellipedemoraes,
It's not a bug for sure, it's the way Grafana Alloy handles the configuration.
I was recently on a call with Grafana's customer. We found out that you also need to whitelist the custom metrics in the config. Usually it's somewhere in the rules where the regex and action is configured (just follow the pipeline). Otherwise the metric is just being filtered out (and hence there's no error nor data).
Once you added the custom metrics name to the regex, it should appear. Please have a look, and let me know if you still have an issue. I'm happy to assist, but it's an issue on the alloy/agent config. 👍