Skip to content
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

vmui: do not expand WITH templates when clicking "prettify query" icon #5383

Closed
valyala opened this issue Nov 23, 2023 · 2 comments
Closed
Assignees
Labels
enhancement New feature or request vmui

Comments

@valyala
Copy link
Collaborator

valyala commented Nov 23, 2023

Is your feature request related to a problem? Please describe

vmui provides the ability to prettify query by clicking the prettify query icon - see this pull request and this issue for details.

The functionality works great most of the time, but unfortunately, it expands with templates. For example, try prettifying the following query:

WITH (my_resource_utilization(free, limit, filters) = (limit{filters} - free{filters}) / limit{filters} * 100)
my_resource_utilization(node_memory_MemFree_bytes, node_memory_MemTotal_bytes, {instance=~"$node:$port",job=~"$job"})

(the query is available at VictoriaMetrics playground )

It is expanded into the following query:

(
  (
    node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"}
      -
    node_memory_MemFree_bytes{instance=~"$node:$port",job=~"$job"}
  )
    /
  node_memory_MemTotal_bytes{instance=~"$node:$port",job=~"$job"}
)
  *
100

Describe the solution you'd like

It would be great if the query would be prettified without the expansion of WITH templates - this is what most users expect. This functionality may be also useful for VictoriaMetrics datasource ( @hagen1778 , FYI)

Describe alternatives you've considered

No response

Additional information

No response

@valyala valyala added enhancement New feature or request vmui labels Nov 23, 2023
valyala added a commit to VictoriaMetrics/metricsql that referenced this issue Feb 18, 2024
@valyala
Copy link
Collaborator Author

valyala commented Feb 18, 2024

VictoriaMetrics shouldn't expand WITH templates during query prettifying after the commit 2e30842 . This commit will be included in the next release.

@valyala
Copy link
Collaborator Author

valyala commented Mar 1, 2024

vmui doesn't expand WITH templates when clicking the prettify query button starting from the release v1.99.0. Closing the feature request as done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request vmui
Projects
None yet
Development

No branches or pull requests

2 participants