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
Return an actual prometheus version in /buildinfo
to accelerate dashboard performence
#5370
Comments
Hey, @noamApps.
But in both cases, you can set the version manually. I will discuss with the team, but i suppose that most likely only the following should be done as part of this issue:
|
Hi @Amper , thanks for replying quickly, indeed I fixed it for my case by manually setting the Prometheus version when registering the datasource. Not sure what happens in a case you don't mention Prometheus type in the performance tab at all, my assumption is it will still assume the worst. Definitely worth mentioning in docs and add to chart, but I wonder if in most scenarios people will just add prometheus datasource without modifying the Perf tab, and in provisioning scenarios, will not define it in the API request to Grafana. The benefit of returning a meaningful |
From my testing it turns out that it doesn't help. I tried adding a version to buildInfo and tested grafana:
|
Got it, Then I think I will open another ticket to Grafana to query I really appreciate the quick response 🚀 |
@Amper , @noamApps , I think an important point is missing in this feature request - the version of Grafana in question. It would be great if VictoriaMetrics could mimic Prometheus for Grafana without the need in manual datasource config changes, if this allows improving performance. According to the latest source code, Grafana uses some technique to determine whether it can use |
Hi @valyala, |
…API for using more efficient API in Grafana for receiving label values, added additional info about setup Grafana datasource (#5370)
@noamApps , could you build single-node VictoriaMetrics from the commit 02a0a7f according to these docs and verify whether this helps Grafana switching to an optimized API for labels` retrieval? @hagen1778 , @Loori-R , could you verify whether VictoriaMetrics datasource for Grafana uses the optimized API for labels` retrieval by default? If this isn't the case, then it should be fixed there. |
VictoriaMetrics should return version |
I understand this approach of returning a Prometheus version, and it avoids having to upstream anything to Grafana, but it's not ideal. For example, let's say Prometheus one day adds a feature that VictoriaMetrics already has (I think it was the case for (Or less likely scenario: Grafana wants to use a feature that only Victoria Metrics API has...) Grafana is already supporting capability checks of various Prometheus-compatible backends like Mimir, Cortext, Thanos. It wouldn't be hard to upstream a PR that adds Victoria Metrics and supports the native version, right? |
At least we can try! @Loori-R would you mind filing such PR? |
Describe the bug
When registering VictoriaMetrics as a Prometheus datasource in Grafana, Unless stated explicitly in the Performence dropdown, Grafana tries to auto discover the Prometheus version by firing a request to
buildinfo
.Currently, VictoriaMetrics returns a success message in the response with no version, I think this makes Grafana assumes the worst and treat the registered Prometheus datasource as an old version Prometheus.
Specifically, this causes Grafana to use the much slower and inefficient
/series
api instead oflabel/values
api forlabel_values
queries which are used in dashboard variables, this can cause significant slowdowns in dashboard performance, especially in load times.In one environment, by explicitly setting the Prometheus datasource as a latest version, I was able to drop the dashboard load time from 30seconds to 160ms, as response size shrunk from 43mb unzipped to 6.7kb
To Reproduce
label_values
that returns a lot of values/series
api that return huge payload after a waiting quite a bit/series
requests are now using labels apiVersion
victoria-metrics-20231002-214928-tags-v1.94.0-0-gf13a96f42
Logs
No response
Screenshots
No response
Used command-line flags
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: