Metric views registered with `register_metric_view` are not shown in Grafana metrics browser
Scenario:
- Create a continuous aggregate metric view
test_metric_delete_me_1mbased on Promscale metric - Register the view with
SELECT register_metric_view('public', 'test_metric_delete_me_1m');
Expected behavior:
Metric test_metric_delete_me_1m is shown in the Grafana metrics browser.
Actual behavior:
Metric is not shown in the Grafana metrics browser after reloading the page. Note that the issue is only with exposing the metric name, the data itself is properly exposed i.e. I get proper data from a query like test_metric_delete_me_1m{__column__="min"}.
Promscale version is 7ae4fb21a1196a2fde0eed7800dce11c31df899c Promscale extension version is 0.5.4.
Somehow related: metrics deleted with drop_metric are still visible in the Grafana metrics browser.
@oliora thanks for reporting the issue!
Metric is not shown in the Grafana metrics browser after reloading the page
I can confirm that with no __column__ provided, no values are returned in Grafana. My guess is that this is because Promscale Caggs always expect a column, as there is no default column. With column provided, it works as expected. I will look into this more and try to get a fix or some reason.
metrics deleted with drop_metric are still visible in the Grafana metrics browser
I tried to reproduce this by deleting a metric using select prom_api.drop_metric('go_gc_duration_seconds');. After deleting, I could not find any data in Grafana. Did you do the same, simply dropping the metric using this function, or something else?
@Harkishen-Singh yes, I’ve just called prom_api.drop_metric as you said. I’ll try to reproduce it one more time and come back.
Btw, before you’ve deleted the metric have you seen it in Grafana metrics explorer?
I can confirm that with no column provided, no values are returned in Grafana
@oliora, to get values in PromQL from Caggs without using __column__, you should create a column with name value while creating Caggs. This is because, when Promscale gets a query without any __column__ label, it looks for this value column. If not found, it returns empty result.
Btw, before you’ve deleted the metric have you seen it in Grafana metrics explorer?
Yes. I first visualised go_gc_duration_seconds in Grafana, then dropped using select prom_api.drop_metric('go_gc_duration_seconds'); (had to restart Promscale because drop_metric needs all Promscale connectors off) and then I couldn't find the metric next.
@Harkishen-Singh I have rechecked the behavior of drop_metric and it does not delete metric names for me. To get metric names Promscale executes SELECT value from _prom_catalog.label WHERE key='__name__' and if I run this query manually I see that all the deleted metrics are still there. The behavior you see may be different because you're deleting cagg metric (aka metric view) rather than a metric itself. I'm sorry if I caused this confusion. I should have created a separate issue for this rather than pegging it back on a metric view issue.
The behavior you see may be different because you're deleting cagg metric (aka metric view) rather than a metric itself
Strange, I deleted the actual metric hyper table using select prom_api.drop_metric('go_gc_duration_seconds');. Will try again but will execute the SQL query you mentioned and see what happens.
Thank you.