DescartesResearch / TeaStore

A micro-service reference test application for model extraction, cloud management, energy efficiency, power prediction, single- and multi-tier auto-scaling
https://se.informatik.uni-wuerzburg.de
Apache License 2.0
118 stars 136 forks source link

Tracing with Jaeger #258

Closed laci9 closed 7 months ago

laci9 commented 8 months ago

Hi, I've tried to trace the system with Jaeger by sidecar injection. In Jaeger UI, I can see all the traces with correct spans but everything has the same operation name op. Is it possible to trace the system and be able to see correct operation names and has someone some experience with that? Thank you for your answer.

SimonEismann commented 8 months ago

Hi @laci9, I unfortunately don't have any experience with instrumenting the TeaStore via Jaeger in Kubernetes.

Could you add a screenshot/example traces to better highlight your issue? Maybe someone with more Jaeger experience comes across this issue :)

laci9 commented 8 months ago

Hi @SimonEismann, thank you for your answer.

I've used this tutorial to set up Jaeger for monitoring and in the screenshots below can be seen that all operation names are just op. I'm using Jaeger version 1.49 and after some investigation I've found out that Jaeger is not using openTracing anymore (from version 1.48 higher) but openTelemetry, so that might be causing issues, but I'm not really sure if that is the root cause as all traces have correct structure.

EDIT: Jaeger should still support openTracing based on 1.49 documentation

Snímka obrazovky 2023-11-14 o 19 24 06 Snímka obrazovky 2023-11-14 o 19 24 24 Snímka obrazovky 2023-11-14 o 19 24 38 Snímka obrazovky 2023-11-14 o 19 25 19 Snímka obrazovky 2023-11-14 o 19 27 01
laci9 commented 8 months ago

I've found the root cause. When building span, it is hardcoded to set the oparation name to op. Link to the source code, where it is set: file

laci9 commented 7 months ago

I solved my issue by adding a parameter to the buildSpanFromHeaders method signature for operation name. Then from extractCurrentSpan(HttpServletRequest request) can be sent also an URL or URI of the request as the operation name.

SimonEismann commented 7 months ago

Glad to hear that you were able to resolve this! Could you open up a PR with your changes? I think this might be useful for other users as well. Hardcoding the operation name to op seems ... not optimal :)

laci9 commented 7 months ago

Sure, here's the link to the pull request.