Observability with OpenTelemetry
wasmCloud is designed to support cloud native observability standards using OpenTelemetry (OTEL). OpenTelemetry is an open source project defining common APIs and standards for telemetry in cloud native systems. As of v0.82.0, wasmCloud emits traces and logs as OTEL signals, with metrics support slated for v1.0.
Data flow
A wasmCloud observability ecosystem must include an OTEL collector, a vendor-agnostic application from the OpenTelemetry project that processes and routes signals. The wasmCloud host emits signals to the OTEL collector, which passes the data on to observability systems such as Grafana.
The OTEL documentation provides detailed instructions on how to install and run the OTEL collector. Additionally, you can find a sample configuration for an OTEL collector in the wasmCloud observability ecosystem demo on GitHub.
While the OTEL collector is the recommended point of configuration for complex signal routing, there are a set of core configurations available at the level of a wasmCloud host.
Configuration
Enable the wasmCloud host to emit OTEL signals with the OTEL_TRACES_EXPORTER
environment variable:
OTEL_TRACES_EXPORTER=otlp
In v0.82, this enables all supported OTEL signals at once—not just traces. (A more accurately descriptive environment variable and command line argument is to come in v1.0.)
By default, OTEL signals are exported on port 4318, the standard HTTP/OpenTelemetry Protocol (otlp
) port. wasmCloud only supports the otlp
format. The endpoint for otlp
exports may be overwritten with the OTEL_EXPORTER_OTLP_ENDPOINT
environment variable:
OTEL_EXPORTER_OTLP_ENDPOINT=http://my-custom-host:4318
While these options are typically passed as part of host configuration, you can launch a wasmCloud observability ecosystem locally by passing environment variables to wash up
:
OTEL_TRACES_EXPORTER=otlp wash up
Launch a wasmCloud observability ecosystem
A set of sample configurations and Docker Compose files are available on GitHub. These samples can be used to launch an example wasmCloud observability ecosystem. Clone or download the wasmCloud repository:
git clone https://github.com/wasmCloud/wasmCloud.git
Change directory to examples/docker
:
cd wasmcloud/examples/docker
Run the docker-compose-otel.yml
file to launch...
- Grafana for dashboards
- The OTEL collector for ingesting OTLP signals from the wasmcloud host
- Tempo for processing traces and passing them to Grafana
- Loki for processing logs and passing them to Grafana
- Prometheus for metrics (wasmCloud metrics support still in development)
docker compose -f docker-compose-otel.yml up
Make sure a wasmCloud host is running locally with OTEL signals enabled:
OTEL_TRACES_EXPORTER=otlp wash up
Now you can access Grafana's "Explore" interface at http://localhost:5050/explore.
Advanced options
Because wasmCloud's implementation of OpenTelemetry observability uses upstream OTEL libraries, a variety of advanced configuration options are available via environment variables defined in the upstream OTEL SDK and OTLP Exporter SDK.
For example, users have several options for trace sampling, log batch management, and setting per signal overrides for endpoints.
Not all upstream options are supported—for example, the wasmCloud host does not support changing format to gRPC.
In cases where the system receives conflicting configurations for the same option via environment variable and command line argument, upstream OpenTelemetry libraries prioritize configurations set via environment variable. Refer to the OpenTelemetry documentation for more details.
Further reading
Signal-specific options on the wasmCloud host are detailed on the traces, logs, and metrics pages. For more information on OpenTelemetry, refer to the project documentation.