[ 
https://issues.apache.org/jira/browse/ARTEMIS-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16581345#comment-16581345
 ] 

Carsten Lohmann commented on ARTEMIS-2028:
------------------------------------------

{quote}
Why not use {{beforeDeliver}} to start the span?
{quote}
Yes, right, I had overlooked the {{beforeDeliver}} and {{afterDeliver}} methods.

{quote}IMO, whatever work is done here should be done without regard to the 
protocol as much as possible. Artemis is a multi-protocol broker and messages 
sent with one protocol can be consumed by another. This functionality shouldn't 
be restricted to a single protocol and we definitely don't want to implement it 
for every protocol individually.{quote}

Yes, sure the tracing feature should be protocol independent. That probably 
came across wrong above.

I think the approach would be
- implement the protocol independent part where spans get created/finished (via 
some (broker) plugin mechanism or directly in Core)
- for each protocol make sure the SpanContext in incoming/outgoing messages can 
get decoded/encoded - possibly translating corresponding protocol-specific 
message-properties into generic message-properties and vice versa
- as an extra/optional step: also create Spans in the protocol acceptors to 
have a more complete Trace - that would be useful for identifying errors that 
occurred on that level.

Using AMQP was just my means of approaching/prototyping the topic here. We can 
remove the reference to that in the ticket title/text.

About the question where to implement the first, "main" part:
With using a broker plugin, there's still the question of the error handling, 
finishing the Spans in such cases. 

Could you imaging extending the broker plugin interface by corresponding 
methods for that? Like "onSendError"/"onMessageRouteError"/"onDeliverError".

> Add OpenTracing support (AMQP)
> ------------------------------
>
>                 Key: ARTEMIS-2028
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2028
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Carsten Lohmann
>            Priority: Major
>         Attachments: Artemis-OpenTracing.png
>
>
> In order to get an overview of the lifetime of a message going through 
> different messaging components, it would be good to have support for 
> distributed tracing in Artemis.
> The [OpenTracing|http://opentracing.io/] standard defines an API for this, 
> facilitating the use of different (OpenTracing-compatible) tracing systems 
> (e.g. [Jaeger|https://jaegertracing.io/]).
> This would mean more general distributed tracing support than the one 
> proposed in ARTEMIS-461.
> To start out with, support could be added to the AMQP protocol, using AMQP 
> delivery annotations to get the OpenTracing SpanContext from incoming 
> messages and to put the SpanContext into outgoing messages.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to