vector
vector copied to clipboard
feat(gcp_stackdriver_logs sink): make project, folder, org and billing_account templateable
Summary
The gcp_stackdriver_logs sink has to support a templateable destination to make vector better at being an aggregator. We can allow gcp_stackdriver_logs destination to be injected with values from the logs or env variables.
Cloud Logging API routes the log to the destination that is specified in the logName of the LogEntry or the top level request body: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry
This PR, makes the available destinations: project, folder, organization or billing_account templateable.
Change Type
- [ ] Bug fix
- [x] New feature
- [ ] Non-functional (chore, refactoring, docs)
- [ ] Performance
Is this a breaking change?
- [ ] Yes
- [x] No
How did you test this PR?
The current integration tests for gcp_stackdriver_logs allows for testing of this feature. I changed one of the test cases to ensure that it encodes correctly into a valid request that contains the correct project name in the LogName
Does this PR include user facing changes?
- [X] Yes. Please add a changelog fragment based on our guidelines.
- [ ] No. A maintainer will apply the "no-changelog" label to this PR.
Checklist
- [X] Please read our Vector contributor resources.
make check-allis a good command to run locally. This check is defined 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)
- [ ] If this PR introduces changes Vector dependencies (modifies
Cargo.lock), please rundd-rust-license-tool writeto regenerate the license inventory and commit the changes (if any). More details here.
References
- Closes: https://github.com/vectordotdev/vector/issues/22433
Hi @saeedek, small request, please don't force push to help us with the review. You can push as many commits as you want. We eventually squash them.
This has merge conflicts now, please fix them and then feel free to request a review from me