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
dataClay is instrumented with `OpenTelemetry <https://opentelemetry.io/>`_ to allow observability of
5
+
distributed traces, metrics, and logs. You can configure tracing to export telemetry data either in real-time or for post-mortem analysis. Visualizations can be performed in Grafana.
6
+
7
+
Configuration
8
+
-------------
9
+
10
+
To activate tracing in dataClay, the following environment variables need to be set:
11
+
12
+
- **`DATACLAY_TRACING`**: Set to `true` to enable tracing.
13
+
- **`DATACLAY_TRACING_EXPORTER`**: Export traces to the OpenTelemetry Collector (`otlp`) or print traces to the console (`console`). The default is `otlp`.
14
+
- **`DATACLAY_TRACING_HOST`**: Host of the OpenTelemetry Collector (default: `localhost`).
15
+
- **`DATACLAY_TRACING_PORT`**: Port of the OpenTelemetry Collector (default: `4317`).
16
+
- **`DATACLAY_SERVICE_NAME`**: The service name, which identifies dataClay components in trace data.
This example demonstrates exporting OpenTelemetry traces to a JSON file for post-mortem analysis in Grafana.
6
+
7
+
1. **Activate tracing** by setting environment variables as described in the `telemetry configuration <https://dataclay.bsc.es/docs/telemetry/configuration>`_.
8
+
2. **Generate traces**:
9
+
10
+
- Navigate to the `json-exporter` folder in the `offline telemetry example JSON exporter <https://github.com/bsc-dom/dataclay/tree/telemetry-doc/examples/telemetry/offline/json-exporter>`_.
11
+
- Start dataClay and OpenTelemetry Collector services:
12
+
13
+
.. code-block:: bash
14
+
15
+
docker compose up
16
+
17
+
- Run the dataClay client:
18
+
19
+
.. code-block:: bash
20
+
21
+
python3 client.py
22
+
23
+
- Traces are exported to the `traces` folder. You can visualize the JSON traces in Grafana.
24
+
25
+
3. **Visualize in Grafana**:
26
+
27
+
- Navigate to the `json-post-mortem` folder in the `offline telemetry example post-mortem <https://github.com/bsc-dom/dataclay/tree/telemetry-doc/examples/telemetry/offline/json-post-mortem>`_.
28
+
- Start the OpenTelemetry Collector, Tempo, and Grafana services:
29
+
30
+
.. code-block:: bash
31
+
32
+
docker compose up
33
+
34
+
- Open Grafana at <http://localhost:3000> (default username/password: `admin`/`admin`).
35
+
- In the `Explore` section, select `Tempo` as the data source and use the `Trace ID` field to query traces.
0 commit comments