Tracing Setup
In order to use Atoti Server’s tracing capabilities, you will need to use your chosen OpenTelemetry-compatible backend, such as OpenTelemetry SDK, to generate anOpenTelemetry instance.
That instance must then be supplied to Atoti Server in one of these two ways:
- Through a call to
Tracing.setOtelInstance(). - By setting the
GlobalOpenTelemetry. Please note that in the event that both of these means are used, the instance supplied throughTracing.setOtelInstance()has precedence.
Tracing.setSpanLevel(). There are three possibilities:
- NONE: continues the parent span.
- SPECIFIC: mode creates new child span when some significant tasks are being invoked, specified in
Tracing#IMPORTANT_TASKS. - TASK: mode creates new child span whenever a new ForkJoinTask is being called.
What identifies a query in a trace?
The span of each query execution carries thequery.id attribute, and all the parts of the execution plan of one query report the same value.
The same value is reported as queryId in the query execution reports of the atoti.server.query.execution logger, so a trace can be joined with them.
The query history records the same 64-bit number as the id of its entry, written as a decimal number.
Each query runs in a Query span of its own, a child of the span current when the query starts, such as the select query span of an MDX query, and its query id is the id of that span.
The id can therefore be looked up in the tracing backend as the span of that query, and several queries sent in parallel, even by a single request, get distinct query ids.
A random id is used instead when tracing is not set up.
In the following diagram, each box is a span: one request sends two queries, and the sub-queries of each query carry the query.id of that query.
Each part of the execution plan also has an id of its own: a sub-query, such as a GET_AGGREGATES query, runs in a Query span of its own too, and takes its id.
The query execution reports give this id under a name that depends on the kind of the part: mdxQueryId, gaqId, drillthroughQueryId or dataNodeQueryId.
Each of these ids is the id of the Query span of that part, written as 16 lowercase hexadecimal characters like any OpenTelemetry span id, so it can be searched as is as a span id in the tracing backend.
For the top-level query, it is equal to queryId.
In the following diagram, each box is a span: an MDX query spawns two GET_AGGREGATES queries, and all three spans carry the same query.id.