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

Set accept header for prometheus client scraping #17291

Merged

Conversation

blakerouse
Copy link
Contributor

@blakerouse blakerouse commented Mar 27, 2020

What does this PR do?

Sets the default Accept header for the prometheus scraper to match the same accept header used by upstream prometheus.

Why is it important?

Some servers that expose prometheus metrics can fail to respond unless this Accept header is present and correct.

Example being the referenced but that returns HTTP error code 406.

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Author's Checklist

  • Accept header is sent on request.

Related issues

@blakerouse blakerouse added bug Team:Platforms Label for the Integrations - Platforms team labels Mar 27, 2020
@blakerouse blakerouse requested a review from a team March 27, 2020 14:19
@elasticmachine
Copy link
Collaborator

Pinging @elastic/integrations-platforms (Team:Platforms)

Copy link
Member

@ChrsMark ChrsMark left a comment

Choose a reason for hiding this comment

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

lgtm!

@blakerouse blakerouse merged commit 268511d into elastic:master Mar 30, 2020
@blakerouse blakerouse deleted the prometheus-default-accept-header branch March 30, 2020 13:46
blakerouse added a commit to blakerouse/beats that referenced this pull request Mar 30, 2020
* Set accept header for prometheus to match the same as prometheus upstream.

* Fix go.mod.

* Add changelog entry.

(cherry picked from commit 268511d)
blakerouse added a commit to blakerouse/beats that referenced this pull request Mar 30, 2020
* Set accept header for prometheus to match the same as prometheus upstream.

* Fix go.mod.

* Add changelog entry.

(cherry picked from commit 268511d)
blakerouse added a commit that referenced this pull request Mar 31, 2020
* Set accept header for prometheus to match the same as prometheus upstream.

* Fix go.mod.

* Add changelog entry.

(cherry picked from commit 268511d)
blakerouse added a commit that referenced this pull request Mar 31, 2020
* Set accept header for prometheus to match the same as prometheus upstream.

* Fix go.mod.

* Add changelog entry.

(cherry picked from commit 268511d)
leweafan pushed a commit to leweafan/beats that referenced this pull request Apr 28, 2023
…stic#17326)

* Set accept header for prometheus to match the same as prometheus upstream.

* Fix go.mod.

* Add changelog entry.

(cherry picked from commit 550feaa)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Team:Platforms Label for the Integrations - Platforms team v7.7.0 v7.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prometheus scrape fails with error 406
4 participants