Skip to content
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

sdk/log: Define in DESIGN.md how Processor and Exporter interfaces can be extended #5318

Closed
pellared opened this issue May 8, 2024 · 4 comments · Fixed by #5347
Closed
Assignees
Labels
area:logs Part of OpenTelemetry logs enhancement New feature or request pkg:SDK Related to an SDK package
Milestone

Comments

@pellared
Copy link
Member

pellared commented May 8, 2024

We should consider creating embedded interfaces as well as no-op implementations for Processor and Exporter. This could make extending these abstractions easier and less frustrating for the users.

This idea came up when I was reviewing open-telemetry/opentelemetry-specification#4030 and open-telemetry/opentelemetry-specification#4024.

Reference: https://pkg.go.dev/go.opentelemetry.io/otel/metric#hdr-API_Implementations

@pellared pellared added enhancement New feature or request pkg:SDK Related to an SDK package area:logs Part of OpenTelemetry logs labels May 8, 2024
@MrAlias
Copy link
Contributor

MrAlias commented May 8, 2024

SDK interfaces are implemented by end-users, not SDK authors. Extending these interfaces will break them and we should not do that.

@pellared
Copy link
Member Author

pellared commented May 8, 2024

Extending these interfaces will break them and we should not do that.

Not if they embed it with a noop implementation.

EDIT: We may also simply add a private() method to the interfaces and add noop implementations that should be embedded.

Side note: I also have a feeling that this proposal is not idiomatic. I think the SDK design doc should describe how we want to extend the SDK if in the specification new methods will be added to the interfaces.

@pellared
Copy link
Member Author

pellared commented May 8, 2024

@MrAlias, would you rather prefer adding new interfaces and options that would support them?

@pellared pellared changed the title [Proposal] sdk/log: Use the embedded pattern for Processor and Exporter interfaces sdk/log: Define in DESIGN.md how Processor and Exporter interfaces can be extended May 9, 2024
@pellared
Copy link
Member Author

pellared commented May 9, 2024

We can refer to https://go.dev/blog/module-compatibility#working-with-interfaces and https://github.com/open-telemetry/opentelemetry-go/blob/main/CONTRIBUTING.md#how-to-change-other-interfaces in the DESIGN.md as a way to add new features to Processor and Exporter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:logs Part of OpenTelemetry logs enhancement New feature or request pkg:SDK Related to an SDK package
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants