Skip to content

Commit 8179fdc

Browse files
authored
Switch to Aspire UI and OTEL collector (#159)
Fixes #134
1 parent 5541408 commit 8179fdc

File tree

7 files changed

+23
-32
lines changed

7 files changed

+23
-32
lines changed

open_telemetry/README.md

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,32 @@ For this sample, the optional `open_telemetry` dependency group must be included
66

77
poetry install --with open_telemetry
88

9-
To run, first see [README.md](../README.md) for prerequisites. Then run the following to start a Jaeger container
10-
with OTLP collector enabled to collect and view the trace results:
9+
To run, first see [README.md](../README.md) for prerequisites. Then run the following to start an [Aspire](https://hub.docker.com/r/microsoft/dotnet-aspire-dashboard/) OTEL collector
1110

12-
docker run -d --name jaeger \
13-
-e COLLECTOR_OTLP_ENABLED=true \
14-
-p 16686:16686 \
15-
-p 4317:4317 \
16-
-p 4318:4318 \
17-
jaegertracing/all-in-one:latest
11+
docker compose up
1812

1913
Now, from this directory, start the worker in its own terminal:
2014

2115
poetry run python worker.py
2216

23-
This will start the worker. Then, in another terminal, run the following to execute the workflow:
17+
Then, in another terminal, run the following to execute the workflow:
2418

2519
poetry run python starter.py
2620

27-
The workflow should complete with the hello result. The workflow trace can now be viewed in Jaeger at
28-
http://localhost:16686/. Under service, select `my-service` and "Find Traces". The workflow should appear and when
29-
clicked, may look something like:
21+
The workflow should complete with the hello result.
3022

31-
![Jaeger Screenshot](jaeger-screenshot.png)
23+
Now view the Aspire UI at http://localhost:18888/.
24+
25+
To view metrics sent describing the worker and the workflow that was executed, select `Metrics` on the left and under "Select a resource" select "temporal-core-sdk". It may look like this:
26+
27+
![Aspire metrics screenshot](aspire-metrics-screenshot.png)
28+
29+
30+
To view workflow spans, select `Traces` on the left and under "Select a resource" select "temporal-core-sdk". It may look like this:
31+
32+
![Aspire traces screenshot](aspire-traces-screenshot.png)
3233

3334
Note, in-workflow spans do not have a time associated with them. This is by intention since due to replay. In
3435
OpenTelemetry, only the process that started the span may end it. But in Temporal a span may cross workers/processes.
3536
Therefore we intentionally start-then-end in-workflow spans immediately. So while the start time and hierarchy is
36-
accurate, the duration is not.
37-
38-
The metrics should have been dumped out in the terminal where the OpenTelemetry collector container is running.
37+
accurate, the duration is not.
446 KB
Loading
433 KB
Loading

open_telemetry/docker-compose.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
services:
2+
aspire-dashboard:
3+
environment:
4+
Dashboard__Frontend__AuthMode: Unsecured
5+
image: mcr.microsoft.com/dotnet/aspire-dashboard:8.0
6+
ports:
7+
- 4317:18889
8+
- 18888:18888

open_telemetry/jaeger-screenshot.png

-20.4 KB
Binary file not shown.

open_telemetry/otel-metrics-collector-config.yaml

Lines changed: 0 additions & 15 deletions
This file was deleted.

open_telemetry/worker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import asyncio
22
from datetime import timedelta
33

4-
import opentelemetry.context
54
from opentelemetry import trace
65
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
76
from opentelemetry.sdk.resources import SERVICE_NAME, Resource

0 commit comments

Comments
 (0)