Skip to main content
Version: 0.82

Traces

Traces are essential for understanding the flow of messages through a distributed system. The wasmCloud host is instrumented to record traces for all control interface and RPC messages.

The wasmCloud host can record and export distributed traces using the OpenTelemetry (OTEL) specification. If you haven't worked with distributed traces before, this primer is a great place to start.

For more information on wasmCloud's implementation of OpenTelemetry, including advanced configuration options, see Observability with OpenTelemetry.

Configuration

By default, tracing is disabled in the wasmCloud host. To enable traces, use the OTEL_TRACES_EXPORTER environment variable:

bash
OTEL_TRACES_EXPORTER=otlp

By default, wasmCloud hosts export traces via HTTP/OpenTelemetry Protocol (otlp) on port 4318.

The endpoint for trace exports may be overwritten with the OTEL_EXPORTER_OTLP_ENDPOINT environment variable:

bash
OTEL_EXPORTER_OTLP_ENDPOINT=http://my-custom-host:4318

These configurations can also be set with the --otel-traces-exporter and --otel-exporter-otlp-endpoint host config options.

Viewing traces with Grafana and Tempo

A set of sample configurations and Docker Compose files are available to help launch a local observability environment. After following the instructions to launch a wasmCloud observability ecosystem, you can navigate to http://localhost:5050/explore, click the dropdown in the upper left, and select "Tempo" to view traces.

There are several ways to query traces in Tempo. To see all traces from the host, change the "Query type" tab to "Search," then click the "Service Name" dropdown and select "wasmcloud-host." You can also increase the "Limit" field to something more than the default (20). To search, press Shift-Enter. You can click on any of the Trace IDs to view all the spans associated with the trace.

Refer to the OTEL_ environment variables in the Docker Compose file for a complete example configuration. The example uses Grafana and Tempo, but wasmCloud works with any OTEL-compatible tracing backend, such as Zipkin, Jaeger, DataDog, Honeycomb, etc.