Skip to content

Add config to disable workflowName tag on metrics (cardinality control) - #1458

Open
michal-treter-text wants to merge 6 commits into
conductor-oss:mainfrom
michal-treter-text:claude/workflow-metrics-config-f8e9bc
Open

Add config to disable workflowName tag on metrics (cardinality control)#1458
michal-treter-text wants to merge 6 commits into
conductor-oss:mainfrom
michal-treter-text:claude/workflow-metrics-config-f8e9bc

Conversation

@michal-treter-text

Copy link
Copy Markdown

Summary

  • Adds conductor.metrics.workflow-name-tag.enabled (default true) to drop the workflowName tag on all metrics recorded via Monitors.java — with many workflow definitions, per-workflow-name tags create unbounded metric cardinality.
  • When disabled, WorkflowMonitor's scheduled workflow_running gauge loop is skipped entirely (rather than dropping just the tag), since dropping the tag mid-loop would make each workflow name's count overwrite the same gauge series — this also saves the per-name DAO count query.
  • All other event-driven workflowName-tagged metrics (workflow_start_success, workflow_start_error, workflow_failure, workflow_execution, task_update_conflict, etc., recorded from WorkflowExecutorOps, DeciderService, WorkflowSweeper, MetadataMapperService) drop just the tag, keeping the aggregate counter/timer meaningful.

Test plan

  • Added WorkflowMonitorTest#testSkipsPendingWorkflowCountWhenWorkflowNameTagDisabled — verifies getPendingWorkflowCount is never called when the flag is off.
  • Added MonitorsTest#workflowNameTagDisabled_dropsWorkflowNameTagFromMetrics — verifies the workflowName tag is absent from the recorded meter when disabled.
  • Updated MetricsCollectorTest for the new constructor param.
  • ./gradlew :conductor-core:test --tests "com.netflix.conductor.metrics.*" (no local JVM available to run in this environment — please verify in CI)

🤖 Generated with Claude Code

michal-treter-text and others added 6 commits August 3, 2026 08:29
Per-workflow-name tagged metrics (workflow_running gauge, plus counters
and timers recorded from execution code) create one time series per
distinct workflow definition name, causing high cardinality when many
workflow defs exist. conductor.metrics.workflow-name-tag.enabled
(default true) drops the workflowName tag across all Monitors call
sites and skips WorkflowMonitor's per-name pending-count query
entirely when disabled.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
MetricsCollector now takes a leading workflowNameTagEnabled boolean;
update the test's manual bean wiring to match.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…8e9bc' into claude/workflow-metrics-config-f8e9bc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant