telemetry

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package telemetry provides OpenTelemetry tracing initialization and span helpers for cleat workflows.

It configures OTLP HTTP export, manages a global tracer, and provides convenience functions for creating workflow-level and event-level spans.

Key functions:

  • InitTracing — initializes OTLP trace export with configurable endpoint
  • WorkflowSpan — creates a span for workflow execution
  • EventSpan — creates a span for workflow events

Index

Constants

This section is empty.

Variables

View Source
var Tracer trace.Tracer

Tracer is the global cleat tracer. It is set by InitTracing and used by WorkflowSpan and EventSpan.

Functions

func EventSpan

func EventSpan(ctx context.Context, step int, eventType, service, operation string) (context.Context, trace.Span)

EventSpan creates a span for a single event in the workflow history.

func InitTracing

func InitTracing(ctx context.Context, endpoint, serviceName string) (func(context.Context) error, error)

InitTracing initializes OTLP trace export. Returns a shutdown function. endpoint is the OTLP HTTP endpoint, e.g., "localhost:4318". serviceName identifies this deployment (e.g., "cleat-worker"). If endpoint is empty, a no-op tracer provider is used and the returned shutdown is a no-op.

func WorkflowSpan

func WorkflowSpan(ctx context.Context, workflowID, defName string, defVersion int, tenantID string, traceID string) (context.Context, trace.Span)

WorkflowSpan creates a root span for a workflow execution. If traceID is a non-empty 32-char hex string, the span is created with a W3C TraceContext parent link for end-to-end propagation.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL