Skip to content

Conversation

yshngg
Copy link
Contributor

@yshngg yshngg commented Jul 30, 2025

The changes introduce a new /format_query API endpoint to handle query formatting in the Prometheus API.

This includes implementing the FormatQuery function in api.go and adding corresponding test cases in api_test.go to ensure proper functionality.

Fix #1845

The changes introduce a new `/format_query` API endpoint to handle query formatting in the Prometheus API. This includes implementing the `FormatQuery` function in `api.go` and adding corresponding test cases in `api_test.go` to ensure proper functionality.

Signed-off-by: yshngg <[email protected]>
@yshngg yshngg force-pushed the feature/format-query branch from 4c76b54 to 1be9221 Compare July 30, 2025 09:09
Copy link
Member

@bwplotka bwplotka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing, thanks!

Co-authored-by: Bartlomiej Plotka <[email protected]>
Signed-off-by: Yusheng Guo <[email protected]>
@bwplotka bwplotka merged commit 40dd084 into prometheus:main Aug 20, 2025
8 checks passed
@bwplotka
Copy link
Member

Ah I missed this, but we need to add this method to our unfortunate interface https://github.com/yshngg/client_golang/blob/83a97306104f6a869e14b28363d63b256c484c84/api/prometheus/v1/api.go#L464 (unfortunate because we should not have it, especially so large - maybe we can remove it one day)

@yshngg
Copy link
Contributor Author

yshngg commented Aug 20, 2025

Understood — my apologies, I missed that as well. I’ll reopen a new Pull Request to add the FormatQuery method to the API interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Proposal to Add FormatQuery Method for API
2 participants