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

Add callback for obtaining autoconfigured OpenTelemetry instance #5021

Closed
jack-berg opened this issue Dec 7, 2022 · 1 comment
Closed

Add callback for obtaining autoconfigured OpenTelemetry instance #5021

jack-berg opened this issue Dec 7, 2022 · 1 comment
Labels
Feature Request Suggest an idea for this project

Comments

@jack-berg
Copy link
Member

Related to #5010.

If an autoconfigured SPI extension component like a SpanExporter, MetricExporter, or LogRecordExporter component wants to instrument itself with the instance of OpenTelemetry being autoconfigured, it current only option is to access GlobalOpenTelemetry.get() lazily. This doesn't work if the autoconfigured instance isn't set as global (i.e. AutoConfiguredOpenTelemetrySdkBuilder.setResultAsGlobal(false)).

A solution to this would be to add an interface like so:

public interface AfterAutoconfigureListener {
  void afterAutoconfigure(OpenTelemetry);
}

We could look for extension components which implement this (exporters, samplers, processors, etc), and invoke afterAutoconnfigure with the OpenTelemetry instance. We discussed this in the Java SIG and @trask hints at it again here.

@jack-berg
Copy link
Member Author

Resolved in #5931.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Suggest an idea for this project
Projects
None yet
Development

No branches or pull requests

1 participant