OpenTracing compatibility


Available since Cinnamon 2.14.2

Under the hood, Telemetry creates custom span objects (we call these “null” and “context-only” spans) to propagate information between contexts. We’ve encountered some issues where these custom types clash with other OpenTracing bridge implementations (e.g., Elastic APM OpenTracing bridge) which can result in class cast exceptions similar to the following:

class cinnamon.opentracing.TraceLocal$ContextOnlySpan cannot be cast to class co.elastic.apm.opentracing.ApmSpan

Cinnamon supports disabling the internal generation of these custom types via two new config parameters:

cinnamon.opentracing {
  # Whether to allow null spans to be activated. Can be disabled if incompatible with tracer implementations.
  activate-null-spans = on

  # Whether to activate dummy spans for context-only trace propagation. Can be disabled if incompatible with tracer implementations.
  activate-context-only-spans = on

These configuration parameters can be set to off to prevent Cinnamon generating these spans.


When context-only spans are disabled, you might still need to access the current SpanContext to create a span connected to it. This can be done via GlobalExtendedTracer. See this API section to see how to achieve it.