-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(gcp_stackdriver_logs sink): Support additional top level labels for gcp_stackdriver_logs sink #22473
base: master
Are you sure you want to change the base?
feat(gcp_stackdriver_logs sink): Support additional top level labels for gcp_stackdriver_logs sink #22473
Conversation
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.
Thank you @stackempty!
I noticed your MR. I just opened a similar one the other day (#22470) with a different approach. If I understand this change correctly, it means you have to put the labels you want to send into the config file, right? My concern with this is that it removes too much of the flexibility labels should give you. You cannot use arbitrary labels anymore but instead have to define everything you want iin the config. This is probably fine if you ship directly to GCP, but if you want to go through an aggregator that becomes impossible to do. |
2a036ab
to
6b76d49
Compare
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.
Thank you @stackempty!
Hi @fbs, this PR introduces template-able labels, which means they can be populated from events dynamically (or statically in the config). Does this solve the issues with your use case? |
In this case only label values are templates, right? The key is still specified by the config. And any key must resolve to a value, even if its just an empty string. My concern is that there are different label keys that make sense for different log entries. E.g. if the log is processed from a kubernetes pod you'd have |
49b2799
to
6f4e6ee
Compare
Hi @fbs, Thanks for sharing your concern! I have made updates to the PR I believe should address them. The
|
0145c14
to
aa2e395
Compare
@pront would you please give this another look! Thanks! |
aa2e395
to
b8f469a
Compare
Summary
This adds top level label field according to LogEntry docs https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#FIELDS.labels!
This will allow users add additional labels to the label field in log entries not just the ones in resource object!
Change Type
Is this a breaking change?
How did you test this PR?
Does this PR include user facing changes?
Checklist
make check-all
is 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 --all
cargo clippy --workspace --all-targets -- -D warnings
cargo nextest run --workspace
(alternatively, you can runcargo test --all
)Cargo.lock
), pleaserun
dd-rust-license-tool write
to regenerate the license inventory and commit the changes (if any). More details here.References
Closes: #8516