You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
revision based on pr feedback, critical requirement oversight was that legacy metrics was never released and thus does not need continued support, it can be replaced wholesale.
- Automatic metrics wiring: `ConductorClient.Builder.withMetricsCollector(...)` installs the HTTP interceptor and auto-registers listeners on `TaskClient` and `WorkflowClient` (automatic in canonical mode; opt-in via `setAutoWiringEnabled(true)` for legacy)
9
+
- Standardized Prometheus metrics: `PrometheusMetricsCollector` now emits the harmonized cross-SDK metric surface — [details](conductor-client-metrics/README.md)
10
+
- Automatic metrics wiring: `ConductorClient.Builder.withMetricsCollector(...)` installs the HTTP interceptor and auto-registers listeners on `TaskClient`, `WorkflowClient`, and `TaskRunnerConfigurer`
11
+
- HTTP API client metrics via OkHttp interceptor (`http_api_client_request_seconds`, `task_result_size_bytes`, `workflow_input_size_bytes`)
12
+
- Event-driven metrics architecture with `EventDispatcher` and typed event POJOs
11
13
12
14
### Changed
13
15
14
-
-Legacy metrics emit unchanged by default; no env var required
16
+
-`PrometheusMetricsCollector` metric names updated to the harmonized cross-SDK catalog (e.g. `task_poll_total`, `task_execute_time_seconds`)
15
17
-`micrometer-registry-prometheus` is now a transitive (`api`) dependency
16
18
17
19
### Deprecated
18
20
19
-
-`PrometheusMetricsCollector` — use `MetricsCollectorFactory.create()` or `MetricsBundle.create()`
20
21
-`TaskClient.ack(String, String)` — use `ack(String taskType, String taskId, String workerId)`
Reference implementation of `MetricsCollector` using Micrometer Prometheus.
248
248
249
249
**Features**:
250
250
- Exposes HTTP endpoint for Prometheus scraping (default: `localhost:9991/metrics`)
251
-
- Selects either the legacy or canonical Prometheus collector at startup
252
251
- Records worker, task client, and workflow client metrics through the event listener system
253
252
- Records HTTP API client metrics through an OkHttp interceptor
254
253
- Keeps the metrics backend separated from task and workflow business logic
255
254
256
-
For setup instructions, environment-variable selection, the complete legacy and canonical metric catalogs, and migration guidance, see [`conductor-client-metrics/README.md`](conductor-client-metrics/README.md).
257
-
258
-
### Compatibility: `PrometheusMetricsCollector`
259
-
260
-
`com.netflix.conductor.client.metrics.prometheus.PrometheusMetricsCollector` is retained as a deprecated alias for `LegacyPrometheusMetricsCollector`. Existing 4.0.x code that does:
continues to compile and emit the same six legacy meter names (`poll_started`, `poll_success`, `poll_failure`, `task_execution_started`, `task_execution_completed`, `task_execution_failure`) byte-for-byte. The shim deliberately delegates to `LegacyPrometheusMetricsCollector`, **not** to `MetricsCollectorFactory.create()`, so an upgrader who already has `WORKER_CANONICAL_METRICS=true` in their environment is not silently flipped to the canonical surface. New code should use `MetricsCollectorFactory.create()` (or `MetricsBundle.create()`) to opt into env-var-driven selection.
255
+
For the complete metric catalog and setup instructions, see [`conductor-client-metrics/README.md`](conductor-client-metrics/README.md).
metricsCollector.startServer(); // port 9991, /metrics
359
348
360
349
// 2. Create ConductorClient — withMetricsCollector installs the HTTP interceptor
361
350
// and enables automatic listener registration on downstream clients
362
351
ConductorClient client =ConductorClient.builder()
363
352
.basePath("http://conductor-server:8080/api")
364
-
.withMetricsCollector(bundle.getCollector())
353
+
.withMetricsCollector(metricsCollector)
365
354
.build();
366
355
367
356
// 3. Downstream clients auto-register as listeners
@@ -376,13 +365,13 @@ TaskRunnerConfigurer configurer = new TaskRunnerConfigurer.Builder(taskClient, w
376
365
configurer.init();
377
366
```
378
367
379
-
For fine-grained control over which listeners are registered, use `withHttpMetrics` instead of `withMetricsCollector`. This installs only the HTTP interceptor and leaves all listener registration to you. See the [Manual Wiring](conductor-client-metrics/README.md#manual-wiring) section in the metrics README.
368
+
For fine-grained control over which listeners are registered, create the `ConductorClient` without `withMetricsCollector`and register listeners explicitly. See the [Manual Wiring](conductor-client-metrics/README.md#manual-wiring) section in the metrics README.
380
369
381
370
### Custom Metrics Endpoint
382
371
383
372
```java
384
373
// Start Prometheus server on custom port and endpoint
`MetricsCollectorFactory.create()` uses the legacy Java SDK metric names by default. Set `WORKER_CANONICAL_METRICS=true` to opt in to the canonical cross-SDK metric names.
320
-
321
-
> Migrating from 4.0.x? `PrometheusMetricsCollector` still works — it is now a deprecated alias for `LegacyPrometheusMetricsCollector` and emits the same six legacy meter names byte-for-byte. New code should use `MetricsCollectorFactory.create()` (or `MetricsBundle.create()`) so it can opt into canonical metrics via `WORKER_CANONICAL_METRICS=true`.
329
+
When a `MetricsCollector` is attached to the `ConductorClient`, downstream clients (`TaskClient`, `WorkflowClient`, `TaskRunnerConfigurer`) automatically register themselves as event listeners.
322
330
323
-
See [conductor-client-metrics/README.md](conductor-client-metrics/README.md) for setup details, the complete legacy and canonical metric catalogs, and migration guidance.
331
+
See [conductor-client-metrics/README.md](conductor-client-metrics/README.md) for the complete metric catalog and setup details.
0 commit comments