-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[pkg/stanza/adapter] Add ability to select one of multiple storage extensions #12871
[pkg/stanza/adapter] Add ability to select one of multiple storage extensions #12871
Conversation
08d4485
to
f51def4
Compare
…tensions Prior to this change, many log receivers could make use of storage extensions. However, selecting a storage extension worked as follows: 1. If exactly one storage extension is configured, use it. 2. If no storage extensions are configured, do nothing. 3. If more than one storage extension is configured, fail. The new behavior depends on a new 'storage' field, which the user can use to indicate which storgae extension a receiver should use. This works as follows: 1. If the user does not specify the 'storage' field, behave the same as above. 2. If the user specifies 'storage: none', do nothing. 3. If the user specifies 'storage: foo', use 'foo'. 4. If 'foo' is not configured or is not a storage extension, fail.
f51def4
to
088f572
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.
Maybe add a second storage extension in the readme?
There's been some additional discussion on the expected behavior over here. New components are not going to use storage extensions by default. Due to this, we need to accept the breaking change (all affected components are still in alpha). I'm moving this PR back to draft status and will make the appropriate updates. |
} | ||
|
||
// Storage explicitly disabled. (e.g. 'storage: false') | ||
if storageID.String() == "false" { |
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.
We probably need to add somewhere in the core a check that "false" is not a valid extension type.
Also, should this be "false" or "none" as the PR description suggests?
A further evolution of this could be: This can be useful if I need a storage for a component but don't care much about what storage exactly it is, or when I have just one storage extension and don't want to repeat its name everywhere I need to use it. |
We discussed, in the Collector SIG today, whether or not implicit attachment of an extension is appropriate at all, even though it is the current behavior in this package. All opinions expressed were in support of requiring explicit configuration. The two reasons cited were:
@tigrannajaryan, I have changed my mind on this and agree with others that pipeline components should have to explicitly opt in to using storage extensions, even though this would be a breaking change for some (alpha) log receivers. How committed are you to the opinion you expressed about preserving the functionality, either for usability or backwards compatibility? |
I agree that explicitly specifying the storage is the right approach.
Are you referring to my proposal to allow @dmitryax do you see any problem with this? I think this is used in our Helm Chart, so the chart may need to be updated. |
Thanks @tigrannajaryan. I was referring to your comments on the related issue here. Sounds like we are on the same page though. 👍 |
Closing in favor of #13418 |
Prior to this change, many log receivers could make use of storage extensions.
However, selecting a storage extension worked as follows:
The new behavior depends on a new 'storage' field, which the user can use to
indicate which storgae extension a receiver should use. This works as follows:
Resolves #10915