-
Notifications
You must be signed in to change notification settings - Fork 2.8k
awsfirehosereceiver: fix named extension loading #39809
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
awsfirehosereceiver: fix named extension loading #39809
Conversation
Fix the loading of extensions to treat the encoding name as a component ID, i.e. a type and optional name. This allows using an encoding extension with a name, e.g. "awslogs_encoding/cloudwatch".
func encodingToComponentID(encoding string) (*component.ID, error) { | ||
componentType, err := component.NewType(encoding) | ||
if err != nil { | ||
var id component.ID |
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.
What if the component.ID
is used in the configuration of the receiver instead?
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.
I think that's a reasonable idea, but I'd like to leave it for a followup - I think it would just be cosmetic, and it's a lot more involved.
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.
Agree the config property should be typed *component.ID
, similar to e.g. https://github.com/open-telemetry/opentelemetry-collector/blob/943627b0fe7273639c860a50a0bbac49021c0b01/exporter/exporterhelper/internal/queuebatch/config.go#L41. This will allow the collector to fail earlier, before trying to start any component.
Also agree this can be a follow-up change.
This PR was marked stale due to lack of activity. It will be closed in 14 days. |
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.
Does this mean the Kafka exporter and Kafka receiver have the same problem?
func encodingToComponentID(encoding string) (*component.ID, error) { | ||
componentType, err := component.NewType(encoding) | ||
if err != nil { | ||
var id component.ID |
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.
Agree the config property should be typed *component.ID
, similar to e.g. https://github.com/open-telemetry/opentelemetry-collector/blob/943627b0fe7273639c860a50a0bbac49021c0b01/exporter/exporterhelper/internal/queuebatch/config.go#L41. This will allow the collector to fail earlier, before trying to start any component.
Also agree this can be a follow-up change.
@andrzej-stencel yes, I'll open issues for them. |
#### Description Fix the loading of extensions to treat the encoding name as a component ID, i.e. a type and optional name. This allows using an encoding extension with a name, e.g. "awslogs_encoding/cloudwatch". #### Link to tracking issue Fixes open-telemetry#39808 #### Testing Unit tests added. #### Documentation None
Description
Fix the loading of extensions to treat the encoding name as a component ID, i.e. a type and optional name. This allows using an encoding extension with a name, e.g. "awslogs_encoding/cloudwatch".
Link to tracking issue
Fixes #39808
Testing
Unit tests added.
Documentation
None