The QueryService/Subscription span is minutes long, which is essentially correct.
But when rendering such as span, the effect is that all other spans (which are msecs or maybe a few seconds) are ‘squeezed’ and the whole overview becomes less usable – all the short spans are rendered equally short. It defies a bit the purpose of this kind of waterfall view.
It would be VERY nice if we could just suppress this kind of span with some configuration property.
Hello @Christian_Bonami, thanks for the comments. I have noticed this as well, but I have not found a way to better represent it. Do you have any suggestions?
In the meantime, you can disable SubscriptionQueryUpdateMessages altogether by using the following configuration:
@Configuration
public class SpanFactoryConfiguration {
@Bean
public SpanFactory spanFactory() {
OpenTelemetrySpanFactory original = OpenTelemetrySpanFactory.builder().build();
return new SpanFactory() {
@Override
public Span createRootTrace(Supplier<String> operationNameSupplier) {
return original.createRootTrace(operationNameSupplier);
}
@Override
public Span createHandlerSpan(Supplier<String> operationNameSupplier, Message<?> parentMessage,
boolean isChildTrace, Message<?>... linkedParents) {
if(parentMessage instanceof SubscriptionQueryUpdateMessage<?>) {
return NoOpSpanFactory.INSTANCE.createHandlerSpan(operationNameSupplier, parentMessage, isChildTrace, linkedParents);
}
return original.createHandlerSpan(operationNameSupplier, parentMessage, isChildTrace, linkedParents);
}
@Override
public Span createDispatchSpan(Supplier<String> operationNameSupplier, Message<?> parentMessage,
Message<?>... linkedSiblings) {
return original.createDispatchSpan(operationNameSupplier, parentMessage, linkedSiblings);
}
@Override
public Span createInternalSpan(Supplier<String> operationNameSupplier) {
String name = operationNameSupplier.get();
if(name.startsWith("EventSourcingRepository.load")) {
name = "EventSourcingRepository.load";
}
String finalName = name
return original.createInternalSpan(() -> finalName);
}
@Override
public Span createInternalSpan(Supplier<String> operationNameSupplier, Message<?> message) {
return original.createInternalSpan(operationNameSupplier, message);
}
@Override
public void registerSpanAttributeProvider(SpanAttributesProvider provider) {
original.registerSpanAttributeProvider(provider);
}
@Override
public <M extends Message<?>> M propagateContext(M message) {
return original.propagateContext(message);
}
};
}
}