You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
open telemetry trace rocketmq via register hook, e.g: TracingSendMessageHookImpl.
In some scenes, rocketmq will register own hook (ConsumeMessageHook/SendMessageHook), e.g: SendMessageTraceHookImpl (SendMessageHook) , or user may register his custom hook. And it may conflict with open telemetry's hook, eg: TracingSendMessageHookImpl, there is an exception when hooks execute
failed to executeSendMessageHookAfter
java.lang.ClassCastException: io.opentelemetry.javaagent.shaded.io.opentelemetry.context.ArrayBasedContext cannot be cast to org.apache.rocketmq.client.trace.TraceContext
for example, SendMessageHook:
SendMessageTraceHookImpl.sendMessageBefore -> context.setMqTraceContext(tuxeContext); // set mqTraceContext field a TraceContext variable
TracingSendMessageHookImpl.sendMessageBefore -> context.setMqTraceContext(instrumenter.start(parentContext, context)); // open telemtry override hook context MqTraceContext field
SendMessageTraceHookImpl.sendMessageAfter -> TraceContext tuxeContext = (TraceContext)context.getMqTraceContext(); // mqTraceContext is not TraceContext type, and throw 'can not be cast to TraceContext' exception
TracingSendMessageHookImpl.sendMessageAfter -> ContextAndScope contextAndScope = (ContextAndScope) context.getMqTraceContext(); // open telemetry get mqTraceContext and do something
maybe add virtual field to hook context is a better solution?
The text was updated successfully, but these errors were encountered:
Resolvesopen-telemetry#6934
As described in the linked issue our usage of rocketmq trace context can
conflict with other hooks that also use `setMqTraceContext`.
LironKS
pushed a commit
to helios/opentelemetry-java-instrumentation
that referenced
this issue
Dec 4, 2022
Resolvesopen-telemetry#6934
As described in the linked issue our usage of rocketmq trace context can
conflict with other hooks that also use `setMqTraceContext`.
open telemetry trace rocketmq via register hook, e.g:
TracingSendMessageHookImpl
.In some scenes, rocketmq will register own hook (
ConsumeMessageHook
/SendMessageHook
), e.g:SendMessageTraceHookImpl
(SendMessageHook
) , or user may register his custom hook. And it may conflict with open telemetry's hook, eg:TracingSendMessageHookImpl
, there is an exception when hooks executefor example, SendMessageHook:
maybe add virtual field to hook context is a better solution?
The text was updated successfully, but these errors were encountered: