Skip to main content

Traces exporter

Traces Exporter

Use tracesExporter in CXExporterOptions to receive native-exported trace batches as OTLP-style JSON maps over the Flutter bridge.

final options = CXExporterOptions(
// ...other options...
tracesExporter: (Map<String, dynamic> batch) {
// Example: batch['resourceSpans'] -> scopeSpans -> spans
debugPrint('Received trace batch with keys: ${batch.keys.toList()}');
},
enableSwizzling: true,
);

Typical payload shape (simplified):

  • resourceSpans (array)
  • resourceSpans[].scopeSpans (array)
  • resourceSpans[].scopeSpans[].spans (array of span objects like traceId, spanId, name, timestamps, attributes)
Last updated on
On this page
Was this page helpful?