Use parent Call.Factory of OkHttpClient to be able to use OpenTelemetry - #1252
Conversation
|
@microsoft-github-policy-service agree |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for the contribution. Can you also add an entry to the changelog?
Lastly you want to check https://github.com/microsoft/kiota and https://github.com/microsoft/kiota-java which is the new stack the next version of the Java SDK is going to rely on.
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for making the changes, would you mind adding an entry to the changelog as well please?
I have had a look at https://github.com/microsoft/kiota-java. |
Yes, did that as well (but got distracted at home in the mean time), just pushed that change. I just the changed code already locally and that works fine, I got traces with OpenTelemetry for the calls send with msgraph sdk library. |
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Thanks for making the changes! And for the contribution!
Ramses Sanchez-Hernandez (@ramsessanchez) for version bump and release.
|
Vincent Biret (@baywet) Ramses Sanchez-Hernandez (@ramsessanchez) It looks like there are some issues with Sonar code scanning integration for building this PR. |
|
Cees Bos (@cbos) this is because the PR is coming from a fork and the policy doesn't allow access to secrets in that context for security reasons. we'll have to override the check to merge this when Ramses Sanchez-Hernandez (@ramsessanchez) has has time to review it. You can disregard it. |
|
Looks good! Vincent Biret (@baywet) , Bump to version 2.0.21? |
|
Ramses Sanchez-Hernandez (@ramsessanchez) yes the next patch is fine |
|
Cees Bos (@cbos) would you be willing to submit a similar pull request to kiota-java (the infrastructure for the next version of the SDK we've been working on) |
@baywat This PR is not merged yet, any idea when that will happen? |
69294af
40a1482 to
69294af
Compare
Vincent Biret (baywet)
left a comment
There was a problem hiding this comment.
Cees Bos (@cbos) sorry for the delay, Ramses Sanchez-Hernandez (@ramsessanchez) has been busy with the last few items on the next version of the SDK, I'll try to expedite this
For application insights it is good to be able to get insights in all incoming and outgoing requests.
OpenTelemetry is the standard for that.
I tried to use https://github.com/open-telemetry/opentelemetry-java-instrumentation/blob/main/instrumentation/okhttp/okhttp-3.0/library/README.md
This gives an exception at runtime
But there is no actual use of casting it to OkHttpClient, only the methods of Call.Factory are used.
As that is the minimal base required, I changed the code as well that in the generic it requires as least Call.Factory as base.