You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: development_docs/traces.md
+73-5Lines changed: 73 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,22 +2,90 @@
2
2
3
3
## Server traces
4
4
5
-
For debugging purposes, we emit OpenTelemetry traces from the server. We emit traces to `~/.marimo/traces/spans.jsonl`. We don't emit any sensitive information in the traces, and these traces stay local to your machine. The traces get wiped on each sever restart.
5
+
For debugging purposes, we emit OpenTelemetry traces from the server. By
6
+
default, traces are written to a local JSONL file. When an OTLP endpoint is
7
+
configured, traces are exported via OTLP instead, letting marimo participate in
8
+
distributed tracing stacks such as Jaeger, Grafana Tempo, or GCP Cloud Trace.
6
9
7
-
You can analyze the traces using tools like Jaeger or Zipkin, or our marimo notebook:
10
+
### Prerequisites
11
+
12
+
Tracing requires the `otel` extra (or a development install, which includes
13
+
the same packages):
8
14
9
15
```bash
10
-
marimo edit scripts/analyze_traces.py
16
+
pip install "marimo[otel]"
11
17
```
12
18
13
19
### Enable Traces
14
20
15
-
To enable traces, set the `MARIMO_TRACING` environment variable to `true`:
21
+
Set `MARIMO_TRACING=true` to turn tracing on:
22
+
23
+
```bash
24
+
MARIMO_TRACING=true marimo run notebook.py
25
+
```
26
+
27
+
### Local file export (default)
28
+
29
+
With no additional configuration, spans are written to
30
+
`~/.marimo/traces/spans.jsonl` (the exact path depends on your platform's
31
+
XDG state directory). The file is cleared on each server restart and never
32
+
leaves your machine.
33
+
34
+
You can analyze local traces with Jaeger, Zipkin, or the bundled notebook:
16
35
17
36
```bash
18
-
MARIMO_TRACING=true ./your_server_command
37
+
marimo edit scripts/analyze_traces.py
19
38
```
20
39
40
+
### OTLP export
41
+
42
+
To export traces to a remote collector, set the standard OpenTelemetry
0 commit comments