vector icon indicating copy to clipboard operation
vector copied to clipboard

feat(gcp_stackdriver_logs sink): make project, folder, org and billing_account templateable

Open saeedek opened this issue 9 months ago • 3 comments
trafficstars

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-all is 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 --all
      • cargo clippy --workspace --all-targets -- -D warnings
      • cargo nextest run --workspace (alternatively, you can run cargo test --all)
  • [ ] If this PR introduces changes Vector dependencies (modifies Cargo.lock), please run dd-rust-license-tool write to regenerate the license inventory and commit the changes (if any). More details here.

References

  • Closes: https://github.com/vectordotdev/vector/issues/22433

saeedek avatar Feb 17 '25 12:02 saeedek

CLA assistant check
All committers have signed the CLA.

bits-bot avatar Feb 17 '25 12:02 bits-bot

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.

pront avatar Feb 26 '25 20:02 pront

This has merge conflicts now, please fix them and then feel free to request a review from me

thomasqueirozb avatar Jun 12 '25 19:06 thomasqueirozb