Skip to content

Add nexus_task_requests metric with client_name tag#9760

Merged
rkannan82 merged 12 commits intomainfrom
krajah/nexus-client-name-metric
Apr 7, 2026
Merged

Add nexus_task_requests metric with client_name tag#9760
rkannan82 merged 12 commits intomainfrom
krajah/nexus-client-name-metric

Conversation

@rkannan82
Copy link
Copy Markdown
Contributor

@rkannan82 rkannan82 commented Apr 1, 2026

What

New nexus_task_requests counter in the matching service with namespace, operation, client_name, and is_internal dimensions. Internal requests are identified by the /temporal-sys/ task queue prefix.

Note: BreakdownMetricsByTaskQueue should not be enabled for /temporal-sys/ queues as they are per-worker and will cause cardinality explosion.

Why

Enables server-side Nexus adoption measurement with SDK breakdown, while allowing consumers to filter out internal Nexus traffic (e.g. worker-commands).

How did you test it?

Unit tests verify correct tag emission for Poll, RespondCompleted, absent-header, and is_internal=true for /temporal-sys/ queues. Functional test proves end-to-end client-name header propagation from frontend through matching.

rkannan82 and others added 3 commits March 31, 2026 20:00
Emit a new nexus_task_requests counter in the matching service handler for
PollNexusTaskQueue, RespondNexusTaskCompleted, and RespondNexusTaskFailed.
The metric carries both task_queue (from the request) and client_name (from
the propagated gRPC client-name header), enabling per-SDK filtering of
internal (temporal-sys/*) Nexus traffic from real customer usage. This is a
server-side replacement for the Envoy-based daily_sdk_usage metric for Nexus
adoption tracking.

The metric is only recorded for direct SDK requests, not forwarded
partition-internal requests.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 marked this pull request as ready for review April 1, 2026 14:48
@rkannan82 rkannan82 requested review from a team as code owners April 1, 2026 14:48
@rkannan82 rkannan82 requested a review from ShahabT April 1, 2026 14:49
@rkannan82 rkannan82 force-pushed the krajah/nexus-client-name-metric branch from dd44dc9 to 480d026 Compare April 1, 2026 14:50
Match the Envoy-based adoption metric dimensions: namespace, operation
(PollNexusTaskQueue, RespondNexusTaskCompleted, RespondNexusTaskFailed),
and client_name. Removed task_queue breakdown since it's not needed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 marked this pull request as draft April 1, 2026 16:29
Skip emitting the metric for task queues prefixed with /temporal-sys/
(server-internal Nexus services like worker-commands) to avoid polluting
adoption metrics with internal traffic.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 removed the request for review from ShahabT April 1, 2026 17:33
Replace skip-on-internal with an is_internal bool tag so consumers can
filter or group by internal vs external Nexus traffic. Internal queues
are identified by the /temporal-sys/ task queue prefix.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 requested a review from ShahabT April 1, 2026 17:46
@rkannan82 rkannan82 marked this pull request as ready for review April 1, 2026 17:46
rkannan82 and others added 3 commits April 1, 2026 12:03
The /temporal-sys/ prefix is not Nexus-specific.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
rkannan82 and others added 3 commits April 6, 2026 22:00
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@rkannan82 rkannan82 enabled auto-merge (squash) April 7, 2026 05:14
@rkannan82 rkannan82 merged commit a133503 into main Apr 7, 2026
46 checks passed
@rkannan82 rkannan82 deleted the krajah/nexus-client-name-metric branch April 7, 2026 05:34
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.

2 participants