Skip to content

feat(http_server source): add configuration for custom HTTP responses#25108

Open
stigglor wants to merge 3 commits intovectordotdev:masterfrom
stigglor:http-responses
Open

feat(http_server source): add configuration for custom HTTP responses#25108
stigglor wants to merge 3 commits intovectordotdev:masterfrom
stigglor:http-responses

Conversation

@stigglor
Copy link
Copy Markdown

@stigglor stigglor commented Apr 2, 2026

Adds a response_source configuration option to the http_server source that accepts a VRL program to generate a custom HTTP response for each request.

Closes: #21013

Summary

Provides functionality to return a custom response (status/body/headers) when required, eg. during payload validation.

Vector configuration

How did you test this PR?

Simple pipeline using the http_server source with a response_source vrl program defined and some if/else clauses returning custom responses to validate different responses (including custom codes/headers/bodies) are returned.

Change Type

  • Bug fix
  • New feature
  • Dependencies
  • Non-functional (chore, refactoring, docs)
  • Performance

Is this a breaking change?

  • Yes
  • No

Does this PR include user facing changes?

  • Yes. Please add a changelog fragment based on our guidelines.
  • No. A maintainer will apply the no-changelog label to this PR.

References

Closes: #21013

Notes

@stigglor stigglor requested review from a team as code owners April 2, 2026 05:32
@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 labels Apr 2, 2026
Copy link
Copy Markdown

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

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: 4325165f04

ℹ️ 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/util/http/prelude.rs
Comment thread src/sources/util/http/prelude.rs
@iadjivon
Copy link
Copy Markdown

iadjivon commented Apr 2, 2026

Hi there,

I've added a work in progress label on this PR on behalf of the Documentation team. Please remove this once the Vector team has approved this PR and we will review.

Thanks!

@pront pront added the meta: awaiting author Pull requests that are awaiting their author. label Apr 6, 2026
@github-actions github-actions bot removed the meta: awaiting author Pull requests that are awaiting their author. label Apr 8, 2026
Copy link
Copy Markdown

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

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: a6f8cb6840

ℹ️ 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/util/http/prelude.rs Outdated
Copy link
Copy Markdown

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

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: a43240ae4e

ℹ️ 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/util/http/prelude.rs
Adds a `response_source` configuration option to the `http_server` source that accepts a VRL
program to generate a custom HTTP response for each request.

Closes: vectordotdev#21013
@stigglor stigglor changed the title feat(http_source): add configuration for custom HTTP responses feat(http_server source): add configuration for custom HTTP responses Apr 8, 2026
Copy link
Copy Markdown

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

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: 27d967bf57

ℹ️ 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/http_server.rs
- Added a note for Non-log events being dropped
- Added a note for EventMetadata::default()` loses vector-namespace metadata
- Added fix for u16 truncation wraps out-of-range status codes
- Added fix for JSON abort message without control keys silently drops body
Copy link
Copy Markdown

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

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: 689682438b

ℹ️ 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/util/http/prelude.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

domain: external docs Anything related to Vector's external, public documentation domain: sources Anything related to the Vector's sources work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

http sources should be able to customise the response sent back to clients

3 participants