Skip to content

enhancement(prometheus scrape): support request headers - #26075

Open
arfa79 wants to merge 5 commits into
vectordotdev:masterfrom
arfa79:feat/prometheus-scrape-headers
Open

enhancement(prometheus scrape): support request headers#26075
arfa79 wants to merge 5 commits into
vectordotdev:masterfrom
arfa79:feat/prometheus-scrape-headers

Conversation

@arfa79

@arfa79 arfa79 commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds configurable HTTP request headers to the prometheus_scrape source. Configured headers are passed to Vector’s shared HTTP client, including support for overriding the default Accept header.

Vector configuration

sources:
  prometheus:
    type: prometheus_scrape
    endpoints:
      - http://localhost:9090/metrics
    headers:
      Accept:
        - application/openmetrics-text
      X-My-Header:
        - custom-value

How did you test this PR?

  • cargo fmt --all -- --check
  • cargo test --no-default-features --features sources-prometheus-scrape sources::prometheus::scrape::test -- --nocapture — 7 passed
  • cargo clippy --no-default-features --features sources-prometheus-scrape --lib -- -D warnings

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. A changelog fragment is included.
  • No.

References

Closes #19656

Notes

Implemented with assistance from OpenAI Codex (GPT-5.6)

Copilot AI lite review requested due to automatic review settings August 9, 2026 15:05
@arfa79
arfa79 requested review from a team as code owners August 9, 2026 15:05
@github-actions github-actions Bot added domain: sources Anything related to the Vector's sources domain: external docs Anything related to Vector's external, public documentation docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. labels Aug 9, 2026
@github-actions

github-actions Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Thank you for your contribution! Before we can merge this PR, please sign our Contributor License Agreement.

To sign, copy and post the phrase below as a new comment on this PR.

Note: If the bot says your username was not found, the email used in your git commit may not be linked to your GitHub account. Fix this at github.com/settings/emails, then comment recheck to retry.


I have read the CLA Document and I hereby sign the CLA


1 out of 2 committers have signed the CLA.
✅ (pront)[https://github.com/pront]
@arfa79
arfa79 seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

This comment was marked as outdated.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33d78fa28a

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread src/sources/prometheus/scrape.rs Outdated
Comment thread src/sources/prometheus/scrape.rs
Comment thread src/sources/prometheus/scrape.rs
@arfa79

arfa79 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@arfa79

arfa79 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@pront pront left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Taking a look at the failing CLA check

@pront

pront commented Aug 11, 2026

Copy link
Copy Markdown
Member

@arfa79 did you add the email used for these commits to your github account?

See 19cab1e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs review on hold The documentation team reviews PRs only after a PR is approved by the COSE team. domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources

Projects

None yet

Development

Successfully merging this pull request may close these issues.

prometheus_scrape source should have request headers configurable

3 participants