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

site: add Tracing - interop with Java-instrumented libraries page #353

Merged
merged 2 commits into from
Nov 10, 2023

Conversation

iRevive
Copy link
Contributor

@iRevive iRevive commented Nov 4, 2023

Partially addresses #202.

@iRevive iRevive force-pushed the docs/java-interop branch 2 times, most recently from dd88b4e to 8cb5194 Compare November 4, 2023 12:17
@iRevive iRevive added the documentation Improvements or additions to documentation label Nov 4, 2023
Copy link
Contributor

@NthPortal NthPortal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my only significant concern is the use of the global otel instance

docs/instrumentation/tracing-java-interop.md Outdated Show resolved Hide resolved
docs/instrumentation/tracing-java-interop.md Outdated Show resolved Hide resolved
docs/instrumentation/tracing-java-interop.md Show resolved Hide resolved
def run: IO[Unit] =
IOLocal(Context.root).flatMap { implicit ioLocal: IOLocal[Context] =>
implicit val local: Local[IO, Context] = localForIoLocal
val otelJava: OtelJava[IO] = OtelJava.local(GlobalOpenTelemetry.get())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, otel recommends not using the global instance. is there another instance we can use relatively easily in examples? because examples invariably get copied into non-example code and end up in production

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An instance can be created AutoConfiguredOpenTelemetrySdk.builder().build(). It creates an autoconfigured instance and does not make it global.

But in this particular example, it must be global because the instance is created by the Otel javaagent upon JVM startup.

Copy link
Contributor Author

@iRevive iRevive Nov 9, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC, otel recommends not using the global instance.

But other examples could be updated (e.g. #348)

@iRevive iRevive merged commit 6c873d1 into typelevel:main Nov 10, 2023
10 checks passed
@iRevive iRevive deleted the docs/java-interop branch November 10, 2023 08:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants