When nesting spans in Elsatic APM through either the Opentracing API or Elastic APM's API. Some spans are never recorded.
Using import * as apm from '@elastic/apm-rum';
:
const transaction = this.apm.startTransaction('transaction-scene-loaded', 'custom'); // recorded
const span = this.apm.startSpan('span-scene-loaded', 'custom'); // recorded
const span2 = this.apm.startSpan('span-loading-state-updated', 'custom'); // Not recorded
span2.end();
span.end();
transaction.end();
Using Elastic's OpenTracing API:
const {
init: initApm,
createTracer
} = require('@elastic/apm-rum/dist/bundles/elastic-apm-opentracing.umd.js');
The behavior for spans are just as inconsistent. It is unclear when a transaction begins or ends. Some spans are translated into transactions, and nested spans may not be recorded. If I declare a page wide transaction, Angular's ngOnInit
can be recorded by a span, but other event hooks are never recorded.
onLoaded() {
const span = this.tracer.startSpan('span-scene-loaded'); // Not recorded
// ...
span.end();
}
I have tried variations of this. Wrapping span in span, childOf, app-level span, individual instances of span.