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: workflows/observability/open-telemetry.mdx
+100-3Lines changed: 100 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -34,10 +34,107 @@ Tilebox Workflows currently supports OpenTelemetry for tracing and logging, with
34
34
35
35
## Integrations
36
36
37
-
Tilebox exports telemetry data using the [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otlp/).
37
+
Tilebox exports telemetry data using the [OpenTelemetry Protocol](https://opentelemetry.io/docs/specs/otlp/). This allows you to send telemetry data to any OpenTelemetry-compatible backend, such as Axiom or Jaeger.
38
+
39
+
### Axiom
38
40
39
41
<imgsrc="/assets/workflows/observability/tilebox-axiom.png"alt="Tilebox is pre-integrated with Axiom" />
40
42
41
-
Axiom, a cloud-based observability and telemetry platform, supports this protocol. Tilebox Workflows has built-in support for Axiom, and the examples and screenshots in this section come from this integration.
43
+
Tilebox Workflows has built-in support for Axiom, a cloud-based observability and telemetry platform. The examples and screenshots in this section come from this integration.
44
+
45
+
To get started, [sign up for a free Axiom account](https://axiom.co/), create an axiom dataset for traces and logs, and generate an API key with ingest permissions for those datasets.
46
+
47
+
You can then configure Tilebox to export traces and logs to Axiom using [configure_otel_tracing_axiom](/workflows/observability/tracing#axiom) and [configure_otel_logging_axiom](/workflows/observability/logging#axiom).
48
+
49
+
### Jaeger
50
+
51
+
<imgsrc="/assets/workflows/observability/tilebox-jaeger.png"alt="Tilebox works well with Jaeger" />
52
+
53
+
Another popular option is [Jaeger](https://jaegertracing.io/), a popular distributed tracing system. You can use the [OpenTelemetry Collector](https://opentelemetry.io/docs/collector/) to collect telemetry data from Tilebox Workflows and export it to Jaeger.
54
+
55
+
An all-in-one Jaeger environment can be spun up using Docker:
56
+
57
+
```bash
58
+
docker run --rm --name jaeger \
59
+
-p 5778:5778 \
60
+
-p 16686:16686 \
61
+
-p 4318:4318 \
62
+
jaegertracing/jaeger:2.9.0
63
+
```
64
+
65
+
You can then configure Tilebox to export traces to Jaeger using `configure_otel_tracing`.
66
+
67
+
<CodeGroup>
68
+
```python Python
69
+
from tilebox.workflows import Client
70
+
from tilebox.workflows.observability.tracing import configure_otel_tracing
71
+
72
+
# your own workflow:
73
+
from my_workflow import MyTask
74
+
75
+
defmain():
76
+
configure_otel_tracing(
77
+
# export traces to the local Jaeger instance
78
+
endpoint="http://localhost:4318",
79
+
)
80
+
81
+
# the following task runner generates traces for executed tasks and
82
+
# exports trace and span data to the specified endpoint
slog.Error("failed to set up otel span processor", slog.Any("error", err))
117
+
return
118
+
}
119
+
otel.SetTracerProvider(tileboxTracerProvider) // set the tilebox tracer provider as the global OTEL tracer provider
120
+
121
+
client:= workflows.NewClient()
122
+
123
+
taskRunner, err:= client.NewTaskRunner(ctx)
124
+
if err != nil {
125
+
slog.Error("failed to create task runner", slog.Any("error", err))
126
+
return
127
+
}
128
+
129
+
err = taskRunner.RegisterTasks(&MyTask{})
130
+
if err != nil {
131
+
slog.Error("failed to register tasks", slog.Any("error", err))
132
+
return
133
+
}
134
+
135
+
taskRunner.RunForever(ctx)
136
+
}
137
+
```
138
+
</CodeGroup>
42
139
43
-
Additionally, any other OpenTelemetry-compatible backend, such as OpenTelemetry Collector or Jaeger, can be used to collect telemetry data generated by Tilebox Workflows.
140
+
The generated workflow traces can then be viewed in the Jaeger UI at [http://localhost:16686](http://localhost:16686).
0 commit comments