You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Spring's WebClient, the first http request using "fresh" netty channels fails to propagate coherent parent trace IDs when run on Kubernetes.
Netty seems to also create a new channel every 100 requests (at that time, OTel has to re-instrument some lambdas).
Broken traces can then also be encountered.
With debug output enabled for the OTel agent, you can see the following log lines when the issue occurs.
Replacing WebClient with RestTemplate fixes this issue and the service produces proper spans from the get-go.
After some debugging the javaagent-instrumentation, I've found that for affected requests the parentContext that's read from a freshly instrumented channel is not null as the HttpClientRequestTracingHandler expects, but an empty instance of ArrayBasedContext.
So far, I could only reproduce this issue when the applications were deployed to kubernetes.
I've tried it on 3 different kubernetes distributions as well as in a docker-compose setup.
Clone repo and cd into local copy
Deploy to Kubernetes (kubectl apply -f k8s) and create appropriate port forwards to your workstation
Hi @trask! That's great! I've just tested it with the latest snapshot agent and, so far, haven't encountered broken traces 👍
I'll do some further testing tomorrow and report back.
This seems to have been fixed. I've rebuilt and tested with the recently released 0.16.0 on my private K3s cluster, on minikube and my company's kubernetes cluster and have not encountered any broken spans since.
Describe the bug
Using Spring's WebClient, the first http request using "fresh" netty channels fails to propagate coherent parent trace IDs when run on Kubernetes.
Netty seems to also create a new channel every 100 requests (at that time, OTel has to re-instrument some lambdas).
Broken traces can then also be encountered.
With debug output enabled for the OTel agent, you can see the following log lines when the issue occurs.
Replacing WebClient with RestTemplate fixes this issue and the service produces proper spans from the get-go.
After some debugging the javaagent-instrumentation, I've found that for affected requests the parentContext that's read from a freshly instrumented channel is not null as the HttpClientRequestTracingHandler expects, but an empty instance of ArrayBasedContext.
Steps to reproduce
I've provided a sample project including kubernetes manifests and docker-compose descriptor at https://github.com/flangknecht/opentelemetry-webclient-k8s
So far, I could only reproduce this issue when the applications were deployed to kubernetes.
I've tried it on 3 different kubernetes distributions as well as in a docker-compose setup.
kubectl apply -f k8s
) and create appropriate port forwards to your workstationkubectl port-forward jaeger-... 16686
kubectl port-forward opentelemetry-service-one-... 8080 1044
What did you expect to see?
All requests hitting service 1 should produce traces with 5 spans.
What did you see instead?
Trace JSONs are available at https://github.com/flangknecht/opentelemetry-webclient-k8s/tree/master/traces
What version are you using?
v0.15.0
Environment
Compiler: AdoptOpenJDK (build 11.0.10+9, mixed mode)
OS:
Linux debtest 5.4.0-65-generic #73-Ubuntu SMP Mon Jan 18 17:25:17 UTC 2021 x86_64 GNU/Linux
v1.20.0+k3s2 (Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:20:00Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"})
Linux debtest 4.19.121-linuxkit #1 SMP Tue Dec 1 17:50:32 UTC 2020 x86_64 GNU/Linux
v1.20.2 (Server Version: version.Info{Major:"1", Minor:"20", GitVersion:"v1.20.2", GitCommit:"faecb196815e248d3ecfb03c680a4507229c2a56", GitTreeState:"clean", BuildDate:"2021-01-13T13:20:00Z", GoVersion:"go1.15.5", Compiler:"gc", Platform:"linux/amd64"})
Linux 5.4.87-flatcar #1 SMP Fri Jan 8 19:54:07 -00 2021 x86_64 x86_64 x86_64 GNU/Linux
v1.18.14 (Server Version: version.Info{Major:"1", Minor:"18", GitVersion:"v1.18.14", GitCommit:"89182bdd065fbcaffefec691908a739d161efc03", GitTreeState:"clean", BuildDate:"2020-12-18T12:02:35Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"})
Linux 5.4.72-microsoft-standard-WSL2
Linux 4.19.121-linuxkit
Runtime: AdoptOpenJDK OpenJDK 64-Bit Server VM 11.0.4+11
Additional context
Also happened with
0.14.0
The text was updated successfully, but these errors were encountered: