This project demonstrates how to integrate Temporal Ruby with OpenTelemetry for observability of your workflow executions. It includes:
- 📊 Basic OpenTelemetry Integration: Currently instrumented for traces only
- ⚡ Temporal Workflow: A simple workflow adapted from the official Ruby quickstart
- 🚀 Two trace backend options:
- Log to stdout with the
consoleexporter - Send to Honeycomb with the OTLP exporter
- Log to stdout with the
In addition to the official Ruby quickstart this project is based on prior work from the community temporal-otel project and WIP official opentelemetry sample.
-
Install Ruby and dependencies:
# Install Ruby with mise mise install # Install all project dependencies bundle
-
Start the Temporal server:
temporal server start-dev
-
Run the worker and demo workflow (in another new terminal):
mise run worker ::: demo
This will run a Temporal worker and invoke a demo script to generate some data to look at. Visit the Temporal UI to see the workflow executions. Exit the worker with Ctrl+c.
To view telemetry generated by the demo workflow use one of the available trace backends:
-
Run the worker and demo workflow and send spans to stdout using the
consoleexporter:mise run console:*
To send telemtry data to Honeycomb you'll need to provide an Ingest API Key via the HONEYCOMB_API_KEY environment variable. For details on how to create this key see the honeycomb docs.
-
In Honeycomb, create an Ingest API Key with the following permissions:
- Can create services/datasets
If you don't have a Honeycomb account, you can sign up for a free Honeycomb account.
-
Add the key to a
.envfile at the root of this project:# Replace with your actual API key HONEYCOMB_API_KEY="hcaik_************"
-
Run the worker and demo workflow and send telemetry data to Honeycomb using the
OTLPexporter:mise run honeycomb:* -
Use Honeycomb to explore your trace data:
