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 alertmanager metrics endpoint when routePrefix is configured #488

Merged
merged 2 commits into from May 31, 2022
Merged

Fix alertmanager metrics endpoint when routePrefix is configured #488

merged 2 commits into from May 31, 2022

Conversation

blesswinsamuel
Copy link
Contributor

VMAlertmanager CR allows us to configure routePrefix field. If this is used, metrics is not accessible at /metrics (it is only accessible at <routePrefix>/metrics. Currently, the metrics endpoint that comes up in the generated VMServiceScrape of alertmanager is /metrics (even if routePrefix is configured). This PR fixes this by adding the route prefix from routePrefix field of vmalertmanager CR, so that the metrics endpoint points to the right path.

When routePrefix is configured for vmalertmanager, metrics is accessible only at <routePrefix>/metrics.
But victoriametrics operator uses the http.pathPrefix extra arg to set the vmservicescrape metrics path.
Alertmanager uses a different extra arg "web.route-prefix" to define the route prefix.
This is fixed by using the route prefix from "web.route-prefix" extra arg.
Copy link
Collaborator

@f41gh7 f41gh7 left a comment

Choose a reason for hiding this comment

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

LGTM

@f41gh7 f41gh7 merged commit 552502d into VictoriaMetrics:master May 31, 2022
@f41gh7
Copy link
Collaborator

f41gh7 commented May 31, 2022

Thanks for contribution!

@blesswinsamuel blesswinsamuel deleted the fix-alertmanager-metrics-endpoint branch May 31, 2022 22:53
@blesswinsamuel blesswinsamuel restored the fix-alertmanager-metrics-endpoint branch May 31, 2022 22:53
@blesswinsamuel blesswinsamuel deleted the fix-alertmanager-metrics-endpoint branch May 31, 2022 22:53
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

2 participants