Forge.Telemetry.OTel (Forge v0.1.1)

View Source

OpenTelemetry integration for Forge (optional).

This module provides OpenTelemetry tracing integration for Forge pipelines. It creates distributed traces with spans for pipeline runs and stage executions.

Setup

To use this module, add OpenTelemetry dependencies to your mix.exs:

def deps do
  [
    {:opentelemetry, "~> 1.3"},
    {:opentelemetry_exporter, "~> 1.6"}
  ]
end

Then configure it in your application:

# config/runtime.exs
config :opentelemetry,
  resource: %{
    service_name: "my_forge_app",
    service_version: "1.0.0"
  }

config :forge, :telemetry,
  reporters: [Forge.Telemetry.OTel]

Spans Created

  • forge.pipeline - Full pipeline execution
  • forge.stage - Individual stage execution

Span Attributes

Pipeline spans include:

  • forge.pipeline.id - Pipeline identifier
  • forge.run.id - Run identifier
  • forge.pipeline.name - Pipeline name
  • forge.pipeline.outcome - Completion outcome
  • forge.pipeline.duration_ms - Duration in milliseconds

Stage spans include:

  • forge.stage.name - Stage name
  • forge.sample.id - Sample identifier
  • forge.stage.outcome - Execution outcome
  • forge.stage.duration_ms - Duration in milliseconds
  • forge.stage.error_type - Error classification (if failed)

Summary

Functions

Attaches telemetry handlers for OpenTelemetry integration.

Functions

attach()

Attaches telemetry handlers for OpenTelemetry integration.

This function should be called during application startup, typically by adding it to the telemetry reporters configuration.