[
https://issues.apache.org/jira/browse/ARTEMIS-2028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16579575#comment-16579575
]
Carsten Lohmann edited comment on ARTEMIS-2028 at 8/14/18 11:12 AM:
--------------------------------------------------------------------
[~jbertram] I've been doing a first prototype adding the code directly to the
AMQP package classes (concentrating on that first).
The result looks like this:
!Artemis-OpenTracing.png|thumbnail!
Now having a look at the broker plugin like you suggested, this would look like
the bare implementation to me:
{code:java}
public class OpenTracingActiveMQServerPlugin implements ActiveMQServerPlugin {
public void beforeSend(...) {
// start "send" span
}
public void beforeMessageRoute(...) {
// start "messageRoute" span (child of "send" span)
}
public void afterMessageRoute() {
// finish "messageRoute" span
}
public void afterSend(...) {
// finish "send" span
}
public void messageAcknowledged(...) {
// no real way to create a span for the time period of sending the
message to the consumer here
}
}
{code}
I see two issues here:
- error handling: what if there is an exception between "beforeSend()" and
"afterSend()"? The "send" span still would need to be finished with an error
here, but I don't see how.
- no way to create a consumer span showing the time it took to send the
message to a consumer
In general, working on the prototype has shown that there are modifications
needed for the AMQP protocol classes:
- extracting the tracing specific AMQP delivery annotations from an incoming
message and making this SpanContext information available somehow (either in
protocol independent message properties or in keeping the SpanContext somewhere
in connection with the message)
- putting tracing specific AMQP delivery annotations in outgoing messages
(currently all delivery annotations are removed)
was (Author: calohmn):
[~jbertram] I've been doing a first prototype adding the code directly to the
AMQP package classes (concentrating on that first).
The result looks like this:
!Artemis-OpenTracing.png!
Now having a look at the broker plugin like you suggested, this would look like
the bare implementation to me:
{code:java}
public class OpenTracingActiveMQServerPlugin implements ActiveMQServerPlugin {
public void beforeSend(...) {
// start "send" span
}
public void beforeMessageRoute(...) {
// start "messageRoute" span (child of "send" span)
}
public void afterMessageRoute() {
// end "messageRoute" span
}
public void afterSend(...) {
// finish "send" span
}
public void messageAcknowledged(...) {
// no real way to create a span for the time period of sending the
message to the consumer here
}
}
{code}
I see two issues here:
- error handling: what if there is an exception between "beforeSend()" and
"afterSend()"? The "send" span still would need to be finished with an error
here, but I don't see how.
- no way to create a consumer span showing the time it took to send the
message to a consumer
In general, working on the prototype has shown that there are modifications
needed for the AMQP protocol classes:
- extracting the tracing specific AMQP delivery annotations from an incoming
message and making this SpanContext information available somehow (either in
protocol independent message properties or in keeping the SpanContext somewhere
in connection with the message)
- putting tracing specific AMQP delivery annotations in outgoing messages
(currently all delivery annotations are removed)
> 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)