question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Fix encoding of OpenTracing span in AMQP messages

See original GitHub issue

My understanding is that the current encoding of OpenTracing information in AMQP messages could cause some issues it is not compliant with the AMQP spec.

About annotations the spec says (http://docs.oasis-open.org/amqp/core/v1.0/os/amqp-core-messaging-v1.0-os.html#type-annotations):

The annotations type is a map where the keys are restricted to be of type symbol or of type ulong. All ulong keys, and all symbolic keys except those beginning with “x-” are reserved. Keys beginning with “x-opt-” MUST be ignored if not understood. On receiving an annotation key which is not understood, and which does not begin with “x-opt”, the receiving AMQP container MUST detach the link with a not-implemented error.

What seems to happen right now is that the MessageAnnotationsInjectAdapter is being used in combination with the TEXT_MAP format, which would directly inject uber-trace-id and uberctx-* into the message annotation map (see: io.jaegertracing.internal.propagation.TextMapCodec):

So it might happen, that a receiver simply closes this link when the annotation is present in the map.

The proposal would be to use something like x-opt-opentracing-trace-id and x-opt-opentracing-ctx- instead.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
calohmncommented, Feb 18, 2019

In general I think it’s a good idea to keep an eye on the AMQP related work in https://github.com/w3c/trace-context/. There’s a draft in https://github.com/w3c/trace-context/pull/217 there. There it is proposed to use a binary format. As this doesn’t seem to be supported by Jaeger yet, I guess it’s premature to adopt it here. In any case I think it would be good to also address https://github.com/eclipse/hono/issues/1012 when doing changes on the Adapter classes here.

1reaction
ctroncommented, Feb 15, 2019

Looking into the code, it actually might be tricky to get the proposal implemented. Maybe a different way to do it would be to keep the current keys of uber-* but put them into the annotations under a single key, using an AMQP map.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix encoding of OpenTracing span in AMQP messages #1046
My understanding is that the current encoding of OpenTracing information in AMQP messages could cause some issues it is not compliant with ...
Read more >
Distributed Tracing with RabbitMQ Using Node.js & Jaeger
In this blog post, we'll be looking at implementing distributed tracing between microservices via a message broker, all with open-source tools.
Read more >
OpenTracing - Apache Camel
The OpenTracing component is used for tracing and timing incoming and outgoing Camel messages using OpenTracing. Events (spans) are captured for incoming ...
Read more >
Spring Cloud Sleuth
The initial span that starts a trace is called a root span . The value of the ID of that span is equal...
Read more >
CoolAMQP Documentation
Optional[opentracing.Span]) – optionally, current span, if opentracing is installed. • dont_trace (bool) – if set to True, a span won't be generated.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found