Skip to content

Add javaagent instrumentation for ktor2#9149

Merged
trask merged 4 commits into
open-telemetry:mainfrom
laurit:ktor2-javaagent
Aug 8, 2023
Merged

Add javaagent instrumentation for ktor2#9149
trask merged 4 commits into
open-telemetry:mainfrom
laurit:ktor2-javaagent

Conversation

@laurit

@laurit laurit commented Aug 7, 2023

Copy link
Copy Markdown
Contributor

Resolves #9144
Resolves #7755

@laurit laurit requested a review from a team August 7, 2023 12:15

@Override
public boolean isHelperClass(String className) {
return className.startsWith("io.opentelemetry.extension.kotlin.");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't this normally be injected by the coroutine instrumentation module? Do we need that here as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This is more about muzzle, if we don't tell it that these are helpers it will fail with Missing class io.opentelemetry.javaagent.shaded.io.opentelemetry.extension.kotlin.ContextExtensionsKt

laurit and others added 2 commits August 8, 2023 15:39
…elemetry/javaagent/instrumentation/ktor/v2_0/ServerInstrumentation.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
…elemetry/javaagent/instrumentation/ktor/v2_0/HttpClientInstrumentation.java

Co-authored-by: Mateusz Rzeszutek <mrzeszutek@splunk.com>
@pkgonan

pkgonan commented Sep 19, 2023

Copy link
Copy Markdown

@laurit @mateuszrzeszutek @trask
Hi.

I am using Ktor client. If I run the Java agent, it doest not extract imstrumentation automatically. How should I use it? OTEL APM does not instrument HTTP Request & Response sent by Ktor Client. I was wondering if I'm misunderstanding something and how to use it. Is this feature does not extract instrumentation automatically?

Ticket

@trask

trask commented Sep 19, 2023

Copy link
Copy Markdown
Member

hi @pkgonan! we would expect this to work, see https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/docs/supported-libraries.md#libraries--frameworks

as @laurit requested #9501 (comment), submitting a minimal repro the best way to help us identify the issue you may be facing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No http.route in Ktor framework Added KTor plugin, but tracing is being suppressed

4 participants