Skip to main content
Mirage can send each line it runs to an OpenTelemetry backend as a trace. Use traces to watch many machines in one place, such as Datadog, Honeycomb, Grafana or Langfuse. Command logs compares traces with the logs Mirage keeps itself.
A session runs a line
↓→
Mirage
writes spans
↓→
OTel SDK
in your process
↓→
OTLP backend
such as Datadog

Setup

Mirage sends nothing until your process sets up an OpenTelemetry SDK. Mirage depends only on the OpenTelemetry API, so install the SDK and an exporter yourself. The exporter picks the backend. Set up the SDK before the workspace runs its first line.
Set up the SDK in code.
agent.py
Or run without code changes. opentelemetry-instrument sets up the SDK for you.
agent.py

Example

Run one line in a workspace that mounts a RAM folder at /data:
Mirage sends one trace with three spans. The command span covers the whole line. The other two sit under it.
These are the command span’s attributes:
The vfs.read span names the file, the mount that served it and the bytes read:

Spans

Each trace covers one line and everything it started. Use the span and attribute names in your backend’s queries, dashboards and alerts.

Attributes to know

Traces cover what runs on the workspace’s machine and the runtimes it reaches. A program that a runtime runs on another host sends no spans of its own.

Limits