Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 5 additions & 10 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -300,17 +300,15 @@ end

### Metrics Collection

The SDK supports legacy and canonical metric surfaces, selected by the
`WORKER_CANONICAL_METRICS` environment variable. `MetricsCollector.create`
returns the appropriate collector:
`MetricsCollector.create` returns a collector that emits the canonical
(harmonized) metric surface:

```ruby
metrics = Conductor::Worker::Telemetry::MetricsCollector.create(backend: :prometheus)
```

See [docs/METRICS_AND_INTERCEPTORS.md](docs/METRICS_AND_INTERCEPTORS.md) for
the full legacy and canonical metrics catalogs, label reference, and migration
guide.
the full metrics catalog and label reference.

### Worker Configuration (3-Tier Hierarchy)

Expand Down Expand Up @@ -407,11 +405,8 @@ lib/conductor/
│ │ ├── listeners.rb # Listener protocol
│ │ └── listener_registry.rb # Registration helper
│ └── telemetry/ # Metrics
│ ├── metrics_collector.rb # Factory (WORKER_CANONICAL_METRICS gate)
│ ├── legacy_metrics_collector.rb # Legacy metric set
│ ├── canonical_metrics_collector.rb # Canonical metric set
│ ├── prometheus_backend.rb # Legacy Prometheus backend
│ └── canonical_prometheus_backend.rb # Canonical Prometheus backend
│ ├── metrics_collector.rb # MetricsCollector class + NullBackend
│ └── prometheus_backend.rb # PrometheusBackend + MetricsServer
└── workflow/
├── dsl/ # Workflow DSL
│ ├── workflow_builder.rb # Core DSL engine (~1000 lines)
Expand Down
10 changes: 4 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Added

- Canonical metrics mode: opt-in harmonized metric surface via `WORKER_CANONICAL_METRICS=true` -- [details](docs/METRICS_AND_INTERCEPTORS.md#detailed-technical-notes----unreleased)
- Canonical (harmonized) metrics as the sole metric surface -- [details](docs/METRICS_AND_INTERCEPTORS.md#detailed-technical-notes----unreleased)
- Bounded `uri` label on `http_api_client_request_seconds`: uses path templates (e.g. `/workflow/{workflowId}`) instead of fully-resolved paths, preventing metric cardinality explosion
- `WorkflowStatusProbe` in harness: opt-in probe (via `HARNESS_PROBE_RATE_PER_SEC`) that exercises UUID-bearing endpoints to validate template URI metrics

Expand All @@ -23,12 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Control flow blocks: `parallel do`, `decide expr do`, `loop_over items do`
- Auto-generated task reference names
- Simplified LLM task methods with hash-to-ChatMessage auto-conversion
- `MetricsCollector.new(...)` is deprecated; use `MetricsCollector.create(...)` instead. `.new` still works but logs a deprecation warning. The previous implementation is preserved as `LegacyMetricsCollector` and remains the default.
- Legacy metrics emit unchanged by default; existing dashboards and alerts continue to work without modification
- HTTP request timing (`http_api_client_request_seconds`) is now zero-overhead in legacy mode: `RestClient` only enters the timing path when a canonical collector is subscribed to `GlobalDispatcher`
- HTTP request timing (`http_api_client_request_seconds`) is zero-overhead when no collector is active: `RestClient` only enters the timing path when a `MetricsCollector` is subscribed to `GlobalDispatcher`
- `thread_uncaught_exceptions_total` is no longer incremented for caught exceptions in the polling loop; the metric surface is retained but unwired, matching the Python and JavaScript SDKs
- Both `CanonicalMetricsCollector` and `LegacyMetricsCollector` now respond to `stop`; `TaskHandler#stop` calls it automatically to unsubscribe from process-wide dispatchers
- `MetricsCollector.create` accepts `measure_payload_size:` (default `true` for canonical, `false` for legacy) to opt out of `workflow_input_size_bytes` JSON serialization overhead
- `MetricsCollector` responds to `stop`; `TaskHandler#stop` calls it automatically to unsubscribe from process-wide dispatchers
- `MetricsCollector.create` accepts `measure_payload_size:` (default `true`) to opt out of `workflow_input_size_bytes` JSON serialization overhead

### Removed

Expand Down
Loading
Loading