refactor(executor): construct the executor metrics scope once#7475
Merged
pingsutw merged 1 commit intoJun 17, 2026
Merged
Conversation
webhook and plugin setup each created a separate promutils.NewScope("executor").
Two independent scopes sharing the "executor:" prefix risk a duplicate-registration
panic on the default Prometheus registry if they ever register a like-named metric.
Build one base scope and give the webhook and plugin distinct sub-scopes
(executor:webhook:, executor:plugin:).
Closes flyteorg#7456
Signed-off-by: davidlin20dev <davidlin20.dev@gmail.com>
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.
Tracking issue
Closes #7456
Why are the changes needed?
executor/setup.goconstructedpromutils.NewScope("executor")twice: once for thewebhook setup and once for the plugin setup context. Two independent scopes sharing
the same
executor:prefix are a latent duplicate-registration panic on the defaultPrometheus registry. If both ever register a like-named metric,
prometheus.Registerreturns
AlreadyRegisteredErrorand theMustNew*helpers panic at startup.What changes were proposed in this pull request?
executorscope once (executorScope := promutils.NewScope("executor")).executorScope.NewSubScope("webhook")andexecutorScope.NewSubScope("plugin")(prefixes
executor:webhook:andexecutor:plugin:).Scoped to webhook + plugin per the issue.
executor:storageandexecutor:catalogalready use distinct names, so they're collision-safe and left untouched. I'm happy to
fold those into the same base scope (emitted names unchanged) here or in a follow-up
if you'd prefer the file fully consistent.
How was this patch tested?
No new unit test, since this is setup wiring with no new logic, and the issue's
criteria only require the executor to start cleanly and existing tests to pass.
Verified locally with
gofmt -l executor/setup.go,go build ./executor/..., andgo vet ./executor/...(all clean). CI exercises./executor/....Labels
Setup process
N/A
Screenshots
N/A
Check all the applicable boxes
Related PRs
N/A
Docs link
N/A