Skip to content

First-Class OpenTelemetry (OTel) Integration #36

@cinar

Description

@cinar

Implement a dedicated observability package (telemetry/resileotel) that automatically emits standardized OpenTelemetry metrics and distributed tracing spans for resilience events.

  • Architecture & Implementation Requirements:
    • Module Isolation: Create this as a separate directory with its own go.mod (or use Go Workspaces) so the core resile library does not take on go.opentelemetry.io/otel as a hard dependency.
    • Instrumenter Interface: Ensure resile has a clean Instrumenter interface with hooks like OnAttempt(ctx, attempt, err), OnCircuitStateChange(state), and OnSuccess(ctx, attempt, duration).
    • Metrics Definitions: Create synchronous counters:
      • resile.calls.total (attributes: policy_name, result=success|failure)
      • resile.retries.total (attributes: policy_name, error_type)
    • Tracing Spans: Wrap the overall Do execution in a parent span (e.g., Resile Execution). Wrap each individual attempt in a child span (e.g., Attempt 1, Attempt 2), attaching the error as a span event if it fails.
  • Acceptance Criteria:
    • Metrics must follow OpenTelemetry semantic conventions.
    • Spans must correctly parent to existing traces provided via the context.Context.
  • Resources:
    • OpenTelemetry Go Documentation
      Would you like me to write the initial prompt to feed these specifications directly to your manager agent to begin the delegation process?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions