observability

command
v1.0.0-beta2 Latest Latest
Warning

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

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

README

Observability hooks

This sample uses the SDK's standard-library observability surfaces: tags, immutable context fields, slog logging, and retry/history metric hooks. It does not add a telemetry framework or an OpenTelemetry collector; DTS-owned durable spans are covered elsewhere.

Run

export DTS_CONNECTION_STRING='Endpoint=http://127.0.0.1:8080;TaskHub=default;Authentication=None'
go run ./samples/observability

What it proves

  • Root tags are visible in metadata and history.
  • Immutable root context fields are persisted and visible in orchestration context/history. Activity contexts receive fields carried by the activity work item plus worker-local fields; current DTS emulator activity work items expose the worker-local field used here.
  • ctx.Logger() suppresses replayed orchestrator output while activity logging keeps task identity fields.
  • Retry and history metric hooks receive bounded, thread-safe signals without depending on exact batch-turn counts.

SAMPLE_OK observability is printed only after field values, log records, metrics, orchestration output, and exact-ID cleanup are verified.

Documentation

Overview

Command observability demonstrates tags, immutable context fields, logs, and metric hooks.

Jump to

Keyboard shortcuts

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