Skip to content

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

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

enhancement(prometheus scrape): support request headers#26075
arfa79 wants to merge 7 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

All contributors have signed the CLA ✍️ ✅
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

@arfa79
arfa79 force-pushed the feat/prometheus-scrape-headers branch from 1eec1c1 to 85ac28e Compare August 13, 2026 16:20
@arfa79

arfa79 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

The CLA failure is resolved. The original commits used an email address that GitHub did not associate with my account, so I rewrote their author/committer emails to my verified GitHub noreply address without changing the file tree. The CLA check now passes.

@arfa79

arfa79 commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

@pront CLA is now passing and the branch has been updated with the latest master. The remaining GitHub Actions runs show action_required, so they need maintainer approval to run for this fork PR.

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