feat(stovepipe): tag controller metrics by queue - #630
Open
mnoah1 wants to merge 1 commit into
Open
Conversation
mnoah1
force-pushed
the
mnoah1/stovepipe-queue-metric-scopes
branch
2 times, most recently
from
August 24, 2026 19:22
f27b81b to
ab4c26c
Compare
mnoah1
force-pushed
the
mnoah1/stovepipe-queue-metric-scopes
branch
4 times, most recently
from
August 25, 2026 17:55
0a71da9 to
71eb860
Compare
mnoah1
marked this pull request as ready for review
August 25, 2026 18:00
mnoah1
requested review from
a team,
behinddwalls and
sbalabanov
as code owners
August 25, 2026 18:00
mnoah1
force-pushed
the
mnoah1/stovepipe-queue-metric-scopes
branch
from
August 25, 2026 19:27
81767ef to
b9ec32a
Compare
mnoah1
marked this pull request as draft
August 25, 2026 19:28
mnoah1
marked this pull request as ready for review
August 25, 2026 19:38
Summary: Attribute Stovepipe controller metrics to the queue carried with each message. Intent: - Make primary and DLQ controller metrics filterable by queue. - Keep message-derived metric context request-local and narrowly scoped. - Propagate queue attribution across message handoffs without repetitive caller metadata. Changes: - Establish queue_name metadata at Stovepipe ingest and propagate it automatically through platform/publish. - Copy only queue_name from delivered metadata into context. - Add metrics.TagsFromContext to append allowlisted context tags and migrate affected metrics. - Preserve explicit publish metadata, payload queue fields as the authority for storage and validation, and rollout compatibility for older messages. Test Plan: - ./tool/bazel test //platform/base/messagequeue:go_default_test //platform/publish:go_default_test //platform/consumer:go_default_test //platform/metrics:go_default_test //stovepipe/controller:go_default_test //stovepipe/controller/build:go_default_test //stovepipe/controller/buildsignal:go_default_test //stovepipe/controller/dlq:go_default_test //stovepipe/controller/process:go_default_test //stovepipe/controller/record:go_default_test Revert Plan: - Revert this commit to restore the prior untagged controller metrics. --- <sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
mnoah1
force-pushed
the
mnoah1/stovepipe-queue-metric-scopes
branch
from
August 25, 2026 20:06
b9ec32a to
e7b28af
Compare
| // Messages published before a context value was introduced return only the | ||
| // additional tags. | ||
| func TagsFromContext(ctx context.Context, tags ...Tag) []Tag { | ||
| queueName, ok := entityqueue.QueueName(ctx) |
Collaborator
There was a problem hiding this comment.
i am wondering if this should depend the base messagequeue context or not? this is bit central in nature so if we add this and say we need something else in some other part of the platform would we also put it here? can we pass the keys which we need to extract in the call itself so we don't need to depend on messagequeue entity itself
behinddwalls
requested changes
Aug 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Tag Stovepipe controller and consumer-framework metrics with the Stovepipe queue that owns each message. Ingest places the queue name in context once; the publish framework persists it under the message metadata key
queue_nameand propagates it across later publishes. Before invoking the gate or controller, the consumer restores it to delivery context.metrics.TagsFromContextthen emits it as the metric tagqueue(for example,queue=monorepo/main).Intent
Approach and reasoning
queue_namestates the intended meaning directly.queue_nameinto a fresh delivery context before checking the gate or callingcontroller.Process.publish.Messageandpublish.MessageWithMetadataclone caller metadata and add the context queue when the caller did not supply that key. Stages no longer need to re-add queue metadata manually, while explicit metadata and intentional overrides remain supported.queue_name, code accesses it throughmessagequeue.QueueName(ctx), and the resulting metric dimension is namedqueue.metrics.TagsFromContextdefines which context values may become tags; it currently extracts onlyqueue.queue_namewas introduced simply emit metrics without thequeuetag.Changes
queue_namemetadata through both platform publish helpers.queue_nameinto delivery context before gate and controller processing.metrics.TagsFromContext.queuemetric tag to primary controller, DLQ controller, gate, and message outcome metrics.Test Plan
./tool/bazel test //platform/base/messagequeue:go_default_test //platform/publish:go_default_test //platform/consumer:go_default_test //platform/metrics:go_default_test //stovepipe/controller:go_default_test //stovepipe/controller/build:go_default_test //stovepipe/controller/buildsignal:go_default_test //stovepipe/controller/dlq:go_default_test //stovepipe/controller/process:go_default_test //stovepipe/controller/record:go_default_testqueue=<queue-name>while older messages without metadata continue processing normally.Revert Plan
Issues