New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PrometheusConnect.check_prometheus_connection() does not work #190
Comments
Perhaps because we are using VictoriaMetrics as storage for prometheus.
But getting metrics works:
Is that the reason? |
It looks like your proxy doesn't have the endpoint
I think that is the reason |
OK. I guess VM is not common enough to warrant an adaptation in this project so I'll close this and implement my own solution. |
@FutureSharks do you have any suggestions for a solution? |
I did this: prom = PrometheusConnect(url=prom_url, disable_ssl=disable_ssl)
test_data = prom.get_metric_range_data(
"prometheus_build_info",
start_time=parse_datetime("1min"),
end_time=parse_datetime("now"),
)
if len(test_data) > 0:
return prom
else:
raise Exception(f"Prometheus connection not working: {prom_url}") But it's not perfect. I will see if there's a |
I think you can use prom.get_current_metric_value(metric_name='up') |
@4n4nd I think that query is quite heavy, for example it returns over 4K items for me. |
oh my bad, i meant to say that you can use |
OK I see what you mean, yes |
Describe the bug
I can get metrics but
PrometheusConnect.check_prometheus_connection()
always returns false.To Reproduce
Expected behavior
PrometheusConnect.check_prometheus_connection()
to returnTrue
The text was updated successfully, but these errors were encountered: