grafana / grafana

The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
https://grafana.com
GNU Affero General Public License v3.0
64.51k stars 12.08k forks source link

Prometheus: Refactor LanguageProvider functions to be able accept range parameter #79802

Open itsmylife opened 10 months ago

itsmylife commented 10 months ago

Each keystroke on variable editor causes a rerender. Recently we implemented a fix to be able to handle time range on variable editor on Prometheus datasource See PR https://github.com/grafana/grafana/pull/78950

Because of the rerenders this effect runs quite frequently and makes calls. Rerenders let us see this problem. To prevent this we implemented a workaround: https://github.com/grafana/grafana/pull/79763

But this is not a good solution. We should refactor PromQlLanguageProvider so it can be used functional way.

bohandley commented 9 months ago

Suggest to do this after the Prometheus library decomposing and decoupling project.