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

fix: support regex for non-query endpoints #226

Conversation

simonpasquier
Copy link
Contributor

PR #171 implemented support for regex label values but only for the query endpoints. This change adds support for all other Prometheus API endpoints.

FYI @sathieu. I remember that we discussed about the issue with the Alertmanager API endpoints but nothing about the non-query Prometheus endpoints. Let me know if the change looks sane.

@sathieu
Copy link
Contributor

sathieu commented Jun 11, 2024

@simonpasquier Thanks for this PR. lgtm!

@@ -378,6 +378,9 @@ func NewRoutes(upstream *url.URL, label string, extractLabeler ExtractLabeler, o
"/api/v1/rules": modifyAPIResponse(r.filterRules),
"/api/v1/alerts": modifyAPIResponse(r.filterAlerts),
}
//FIXME: when ModifyResponse returns an error, the default ErrorHandler is
//called which returns 502 Bad Gateway. It'd be more appropriate to treat
//the error and return 400 in case of bad input for instance.
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

@squat squat left a comment

Choose a reason for hiding this comment

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

Great work @simonpasquier one comment but not blocking

PR prometheus-community#171 implemented support for regex label values but only for the
query endpoints. This change adds support for all other Prometheus API
endpoints.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
@simonpasquier simonpasquier merged commit d4af27e into prometheus-community:main Jun 12, 2024
4 checks passed
@simonpasquier simonpasquier deleted the update-regex-match-support branch June 12, 2024 14:59
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.

None yet

3 participants