Skip to content

codeconfab/temporal-ruby-otel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temporal Ruby + OpenTelemetry

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 console exporter
    • Send to Honeycomb with the OTLP exporter

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.

Usage

Prerequisites

Quick Start

  1. Install Ruby and dependencies:

    # Install Ruby with mise
    mise install
    
    # Install all project dependencies
    bundle
  2. Start the Temporal server:

    temporal server start-dev
  3. 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.

Explore Traces

To view telemetry generated by the demo workflow use one of the available trace backends:

📝 Log to stdout

  1. Run the worker and demo workflow and send spans to stdout using the console exporter:

    mise run console:*

🔍 Send to Honeycomb

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.

  1. 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.

  2. Add the key to a .env file at the root of this project:

    # Replace with your actual API key
    HONEYCOMB_API_KEY="hcaik_************"
  3. Run the worker and demo workflow and send telemetry data to Honeycomb using the OTLP exporter:

    mise run honeycomb:*
  4. Use Honeycomb to explore your trace data:

    Example of demo workflow trace in Honeycomb

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages