Skip to main content

Hi everyone,

we are currently looking at implementing tracing with OpenTelemtry. 

There is some documentation regarding doing this with OpenTelemetry: https://docs.commercetools.com/sdk/observability/opentelemetry

Sadly, it is not clearly stated what’s even possible and/or implemented.

Are requests fully e2e traceable? Example: If our backend sends a trace ID and we receive a callback later, will that callback contain the trace ID? Is W3C as standard used? 

Thanks!

Thanks for getting in touch with your questions about using OpenTelemetry with Commercetools SDK.

I want to let you know that both our TypeScript and Java SDKs do support end-to-end (e2e) traceability. You can view individual request spans to see all the paths your request takes, including any internal libraries and middleware involved during the process. However, I should mention that we haven’t implemented the W3C standard for this.

If you’re running into any issues, could you share a code snippet? That’ll help us understand the situation better and offer more specific guidance.


Thank you for answering that fast!

» I want to let you know that both our TypeScript and Java SDKs do support (...)

The documentation seems to be not up-to-date in this case. The OpenTelemetry documentation only lists Java and .Net SDK, while you also mentioned Typescript which just contains some hints within its documentation but is not mentioned in the overarching page.

 

» However, I should mention that we haven’t implemented the W3C standard for this.

What standard is than implemented? That answer left me a little bit confused. Generally, the documentation regarding tracing is not really clear, but I think it makes sense to give you more insights:

We have a large landscape of applications which interact with each other. One of these applications uses Commercetools as their backend. We have introduced tracing (OpenTelemetry) within that landscape. Now, we also want to include into tracing that particular application which uses Commercetools. Problem is that, to our understanding, Commercetools does not offer a delegation of traces through their system.

Example:

System A → System B → CommerceTools → System B → System A

If “System A” starts with a trace ID “1”, then it should finally receive the same trace ID. 

 

Hopefully, you prove our understanding to be wrong. 🤗

 

 


The SDK allow the usage of observability agents to trace requests/responses to commercetools. The docs provide examples how to do so for different providers like OpenTelemetry, NewRelic, Datadog and Dynatrace.

The tracing is limited to the boundaries of the API. So any tracing headers sent aren’t forwarded to extension or subscription services. They are also not being sent back in the response.


Jens, thanks for joining the community and answering my question!

The tracing is limited to the boundaries of the API. So any tracing headers sent aren’t forwarded to extension or subscription services. They are also not being sent back in the response.

Are there any plans implementing that? By introducing Commercetools, companies would basically break their tracing setup because of that.. 

We also thought about doing it manually using e.g. the correlation-ID but this breaks e.g. when using subscriptions.


Thank you for highlighting this, Maximilian. We’re aware of the situation and are currently evaluating the possibilities. We appreciate your input and will keep you updated as we assess how it fits into our plans.


@Maximilian B. Keep a lookout for our 2024 Q4 Roadmap, we will have some exciting new features around monitoring included!


Reply