-
Notifications
You must be signed in to change notification settings - Fork 3.3k
[exporter/googlecloudstorage] Add use_existing config to skip bucket creation #45971
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
base: main
Are you sure you want to change the base?
[exporter/googlecloudstorage] Add use_existing config to skip bucket creation #45971
Conversation
|
Welcome, contributor! Thank you for your contribution to opentelemetry-collector-contrib. Important reminders:
A maintainer will review your pull request soon. Thank you for helping make OpenTelemetry better! |
83f2b0a to
781274e
Compare
constanca-m
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 doesn't seem right.
Bucket creation is managed externally (Terraform, CloudFormation, etc.)
I have tried with a TF bucket and this works fine. What errors are you getting?
| // exists. If it is set to false, an error will be thrown if the | ||
| // bucket already exists. Otherwise, the existent bucket will be | ||
| // used. | ||
| // used. This flag is ignored if UseExisting is true. |
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 flag is ignored if UseExisting is true.
Why is this flag no enough?
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.
Hi @constanca-m , are you referring to the ReuseIfExists flag ?
The issue I am facing when using this exporter is that ReuseIfExists is not single responsibility as it relies on an error message after it tries to create the bucket on a project level.
For security reasons, I am granting permission on an object level which makes this current implementation require excessive permissions (project level vs object level).
Does that answer your above question ? I can provide more context if necessary
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.
It makes sense. Can you then improve the reuseifexists implementation to your use case? I feel we are just basically adding a flag for the same use case
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.
Let me refactor it then!
…creation Add a new use_existing configuration option that allows the exporter to skip bucket creation entirely and assume the bucket already exists. This is useful when: - Bucket creation is managed externally (Terraform, CloudFormation, etc.) - Service account lacks bucket creation permissions - Organization policy requires bucket creation through separate processes The existing reuse_if_exists behavior is preserved for backward compatibility. When use_existing is true, it takes precedence and skips creation entirely. Assisted-by: Claude Sonnet 4.5
781274e to
ceb17f7
Compare
Description
Adds a new
use_existingconfiguration option to the Google Cloud Storage exporter that allows it to skip bucket creation entirely and assume the bucket already exists.Motivation
This is useful when:
Changes
use_existingboolean field to bucket configurationuse_existing=true: Skip creation entirelyuse_existing=false: Attempt creation with existingreuse_if_existsfallback behaviorBackward Compatibility
The existing
reuse_if_existsbehavior is preserved for backward compatibility. Whenuse_existingis true, it takes precedence and skips creation entirely.Testing
use_existing_bucket_without_creationLink to tracking Issue
Fixes #45971