OpenTelemetry Console Trace Exporter
OpenTelemetry Console Trace Exporter allows the user to send collected traces to console.debug.
Setup
Google Cloud Trace is a managed service provided by Google Cloud Platform.
Installation
npm install --save @fetsorn/opentelemetry-console-exporter
Usage
Install the exporter on your application, register the exporter, and start tracing.
const { ConsoleExporter } = require('@fetsorn/opentelemetry-console-exporter');
const exporter = new TraceExporter({
// If you want more detailed view, you will need to specify `isDetailed = true` here
});
Now, register the exporter.
provider.addSpanProcessor(new BatchSpanProcessor(exporter));
Exporter requires BatchSpanProcessor
to analyze the trace hierarchy.
- BatchSpanProcessor: The implementation of the
SpanProcessor
that batches ended spans and pushes them to the configuredSpanExporter
.
Useful links
- For more information on OpenTelemetry, visit: https://opentelemetry.io/
- For more about OpenTelemetry JavaScript: https://github.com/open-telemetry/opentelemetry-js
- Check out how this exporter is used in Polywrap: https://github.com/polywrap/monorepo