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

agent: return req error if prometheus metrics are disabled. #10140

Merged
merged 4 commits into from
Mar 10, 2021
Merged

Conversation

jrasell
Copy link
Member

@jrasell jrasell commented Mar 9, 2021

If the user has disabled Prometheus metrics and a request is
sent to the metrics endpoint requesting Prometheus formatted
metrics, then the request should fail.

The returned response code copies that of Consul, to provide a
consistent user experience.

It also fixes a knock-on test failure which assumed Prometheus
formatted metrics were available from the test server.

closes #10070

@jrasell jrasell added type/bug theme/api HTTP API and SDK issues theme/metrics labels Mar 9, 2021
@jrasell jrasell requested review from tgross and cgbaker March 9, 2021 11:20
@jrasell jrasell self-assigned this Mar 9, 2021
@jrasell jrasell changed the title api: fix operator test based on metrics Prometheus format fix. agent: return req error if prometheus metrics are disabled. Mar 9, 2021
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM 👍

Let's add a changelog entry and leave a note in the upgrades guide so that users notice this.

command/agent/metrics_endpoint.go Outdated Show resolved Hide resolved
If the user has disabled Prometheus metrics and a request is
sent to the metrics endpoint requesting Prometheus formatted
metrics, then the request should fail.
@jrasell
Copy link
Member Author

jrasell commented Mar 10, 2021

requesting re-review to get eyes on the documentation changes I have added to this PR.

Copy link
Member

@tgross tgross left a comment

Choose a reason for hiding this comment

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

LGTM

website/content/docs/upgrade/upgrade-specific.mdx Outdated Show resolved Hide resolved
Co-authored-by: Tim Gross <tgross@hashicorp.com>
Copy link
Contributor

@cgbaker cgbaker left a comment

Choose a reason for hiding this comment

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

LGTM, thanks, @jrasell

@jrasell jrasell merged commit ded978c into main Mar 10, 2021
@jrasell jrasell deleted the b-gh-10070 branch March 10, 2021 16:11
@tgross tgross added this to the 1.1.0 milestone Mar 30, 2021
schmichael pushed a commit that referenced this pull request May 14, 2021
agent: return req error if prometheus metrics are disabled.
@github-actions
Copy link

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

telemetry: Prometheus config flag prometheus_metrics doesn't alter endpoint behaviour
3 participants