Skip to content

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

Conversation

axw
Copy link
Contributor

@axw axw commented May 1, 2025

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

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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Member

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.

@axw axw marked this pull request as ready for review May 1, 2025 08:53
@axw axw requested a review from a team as a code owner May 1, 2025 08:53
@axw axw requested a review from songy23 May 1, 2025 08:53
Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label May 17, 2025
@github-actions github-actions bot removed the Stale label May 19, 2025
Copy link
Member

@andrzej-stencel andrzej-stencel left a 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
Copy link
Member

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 andrzej-stencel merged commit c0725f9 into open-telemetry:main May 19, 2025
175 checks passed
@github-actions github-actions bot added this to the next release milestone May 19, 2025
@axw axw deleted the awsfirehosereceiver-encoding-componentid branch May 20, 2025 03:39
@axw
Copy link
Contributor Author

axw commented May 20, 2025

@andrzej-stencel yes, I'll open issues for them.

dragonlord93 pushed a commit to dragonlord93/opentelemetry-collector-contrib that referenced this pull request May 23, 2025
#### 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[receiver/awsfirehose] Encoding configuration fails if the ID contains /
5 participants