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

[instrumentation] research adding experimental features to Instrumentation, InstrumentationBase #4839

Open
3 tasks
Tracked by #4586
pichlermarc opened this issue Jul 1, 2024 · 0 comments
Labels
never-stale pkg:instrumentation type:research Something needs to be researched, results should be documented on the issue.

Comments

@pichlermarc
Copy link
Member

pichlermarc commented Jul 1, 2024

Description:

Types from @opentelemetry/api-logs are used in the public interface and may break compatibility when using different versions of the instrumentation base in the same app. It also may break (type-)compatibility if there's a different version of @opentelemetry/api-logs installed in the end-user's app and the @opentelemetry/instrumentation package. These breakages can occur even if the user does not use these experimental features.

Once we release @opentelemetry/instrumentation as 1.x, the public interface should only include types from stable packages. As such we may need to remove @opentelemetry/api-logs types from the public interface before we stabilize @opentelemetry/instrumentation. Further, we may want to add experimental functionality to the @opentelemetry/instrumentation package (for instance @opentelemetry/api-events). Before releasing the package as stable, we want to ensure that we add new experimental and stable features in a non-breaking manner.

This issue is intended to track research on this topic and should lead to an issue to find and prototype a solution to this problem.
Keep in mind that the current structure of @opentelemetry/instrumentation may not be well-suited to adding features like this and may require significant changes.

This issue is considered done when:

  • An approach has been found and presented to the SIG (in the SIG meeting or in a seperate meeting set up by the @open-telemetry/javascript-maintainers)
    • This should include a draft PR in advance which illustrates the chosen approach, including any neccessary changes to at least one instrumentation package here in this repo. (examples: @opentelemetry/instrumentation-http, @opentelemetry/instrumentation-grpc)
  • The approach was accepted by the maintainers (indicated when maintainers reach consensus on the draft PR)
  • A follow-up issue was crated and linked here as well as in [instrumentation] instrumentation base stabilization plan #4586 and in the contrib repo to implement the chosen approach.

Approaches to consider:

This section lists possible approaches to consider. The list of approaches here is intended to get the person working on this started. If you find better options, feel free to prototype and pursue these options.

experimental entrypoint:

Creating an @opentelemetry/instrumentation/experimental entrypoint with ExperimentalInstrumentation and ExperimentalInstrumentationAbstract exports that extend Instrumentation and InstrumentationAbstract can be an option. Experimental features may be added to these interfaces, and consumers of this entrypoint MUST depend on a tilde version (~1.2.3) of the stable @opentelemetry/instrumentation if they consume experimental features.

Doing so may allow instrumentation that do not provide experimental signals to depend on ^1.0.0 of @opentelemetry/instrumentation.

Reconsider extending InstrumentationAbstract in every instrumentation

We may need to consider moving away from the current model where instrumentations extend InstrumentationAbstract as adding any non-optional field (even protected and private can be breaking for TypeScript users).

One option may be changing the Instrumentation interface to allow passing an InstrumentationHelper that provides the current functionality of InstrumentationAbstract. Instrumentations may then implement the Instrumentation interface directly. This approach here would likely also require us to have a way to pass an ExperimentalInstrumentationHelper to the the Instrumentation, which may also require an experimental entrypoint or at least @experimental annotations, similar to what is mentioned in the previous section.

Side note: when going this was we may go with a soft approach of launching 1.x with a deprecated InstrumentationAbstract still available to avoid current implementations from breaking, but strongly recommend people move to the new approach

Additional Notes:

This issue is part of #4586

@pichlermarc pichlermarc added never-stale pkg:instrumentation needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation type:research Something needs to be researched, results should be documented on the issue. labels Jul 1, 2024
@pichlermarc pichlermarc added never-stale and removed never-stale needs:refinement This issue needs to be refined/broken apart into sub-issues before implementation labels Jul 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
never-stale pkg:instrumentation type:research Something needs to be researched, results should be documented on the issue.
Projects
None yet
Development

No branches or pull requests

1 participant