-
Notifications
You must be signed in to change notification settings - Fork 2k
enhancement(vector source): add headers option
#22695
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
Conversation
headers option
pront
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @anil-db
| /// | ||
| /// Specifying "*" results in all headers included in the log event. | ||
| /// | ||
| /// These headers are not included in the JSON payload if a field with a conflicting name exists. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we want to expose this as an option e.g. override_headers
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This specification is exactly same as for http_server it should be consistent across both in my option. https://vector.dev/docs/reference/configuration/sources/http_server/#headers
Co-authored-by: Pavlos Rontidis <pavlos.rontidis@gmail.com>
pront
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks reasonable, thanks @anil-db
2a85007
|
Hi @anil-db, this broke one one of nightly checks. Can you take a look please? A forward fix should be doable here. Alternatively, I can revert the PR and investigate this later. |
headers optionheaders option
do you know how to run nightly build locally. I think it is feature dependency issue. I have to add feature dependency in sources-vector to sources-http-server because it is using some code from there. |
It's the |
Hi @anil-db, let me know if you are interested in reviving this PR and if the above makes sense. Happy to help. |
Summary
This PR adds option to include http headers in vector source log events similar to http source.
most of function and structs are reused from http source.
Use case: we have a use case where between vector sink in edge node and vector source in aggregator, there is a proxy.
this proxy is responsible for validation and adding a header for
Provenancepurpose for log source.we need to attach this Provenance header value to log event in aggregator which later will go to ETL pipeline.
GRPC protocol provide these headers as metadata and it seems tonic's Request struct exposes them as metadata but vector source just drops/ignores that field.
This pr is trying to use that metadata to add the header in log event is configure.
by default header config is empty string hence no data is added.
Change Type
Is this a breaking change?
How did you test this PR?
tested manually
with below config
a sample log message with envoy header added as event property.
Does this PR include user facing changes?
Checklist
make check-allis a good command to run locally. This check isdefined here. Some of these
checks might not be relevant to your PR. For Rust changes, at the very least you should run:
cargo fmt --allcargo clippy --workspace --all-targets -- -D warningscargo nextest run --workspace(alternatively, you can runcargo test --all)Cargo.lock), pleaserun
dd-rust-license-tool writeto regenerate the license inventory and commit the changes (if any). More details here.References