Skip to content

Sample for working with Temporal OpenTelemetry integration.

Notifications You must be signed in to change notification settings

temporal-community/temporal-otel

Repository files navigation

Temporal OpenTelemetry Samples

This project demonstrates how to integrate Temporal with OpenTelemetry for complete observability of your workflow executions. It includes:

  • 📊 Complete observability stack: OpenTelemetry traces, metrics, and logs
  • Temporal Workflow: HTTP GET workflow with full telemetry instrumentation
  • 🔄 OpenTelemetry Collector: Central hub for processing and routing telemetry data
  • 🚀 Two deployment options:
    • Open-source tools (Jaeger, Prometheus, and Elasticsearch)
    • Dynatrace

💡 New to OpenTelemetry? Check out our OpenTelemetry Primer to understand the concepts, benefits, and why it matters for Temporal developers.

Usage

Prerequisites

Quick Start

  1. Install Python and dependencies:

    # Install Python 3.12 if needed
    uv python install 3.12
    
    # Install all project dependencies
    uv sync --dev
  2. Start the observability stack:

    # Starts Temporal server + Jaeger + Prometheus + Elasticsearch + OTEL Collector
    uv run poe up

    Wait for all services to start (about 30-60 seconds). You'll see logs from multiple containers.

  3. Run the demo workflow (in another new terminal):

    uv run poe client

    This continuously executes HTTP workflows every 2 seconds. You'll see workflow IDs being printed.

Explore Your Telemetry Data

Now that everything is running, explore the observability data:

🔍 Distributed TracesJaeger

  • Go to http://localhost:16686/
  • Click "Find Traces" to see traces
  • Click on any trace to see the complete Temporal Workflow → Activity call chain

📊 MetricsPrometheus

  • Go to http://localhost:9090/
  • Try queries like:
    • temporal_workflow_completed_total - completed workflows
    • temporal_worker_task_slots_available - available execution slots in Worker

📝 LogsElasticsearch

  • Query logs: curl http://localhost:9200/temporal-logs/_search | jq
  • Or browse with: curl http://localhost:9200/_cat/indices

⚙️ Temporal UITemporal Web

🛠️ Deployment Options

By default, this project uses open-source observability platforms (Jaeger, Prometheus, and Elasticsearch) to storage Temporal traces, metrics, and logs.

To learn more about how this solution works with third-party observability vendors, use the following step-by-step instructions:

  1. Dynatrace

To see the OpenTelemetry outputs from Nexus operations, try running the Nexus sample.

🏗️ Want to understand the architecture? See our Architecture Documentation for a comprehensive overview of how Temporal and OpenTelemetry components work together.

🤝 Contributing

We welcome contributions from the community! Whether you want to add new OpenTelemetry integrations, improve documentation, or enhance existing examples, check out our Contributing Guide to get started.

About

Sample for working with Temporal OpenTelemetry integration.

Resources

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published