<#7475 refactor(executor): construct the executor ...
# flyte-github
a
#7475 refactor(executor): construct the executor metrics scope once Pull request opened by davidlin20dev Tracking issue Closes #7456 Why are the changes needed?
executor/setup.go
constructed
promutils.NewScope("executor")
twice: once for the webhook setup and once for the plugin setup context. Two independent scopes sharing the same
executor:
prefix are a latent duplicate-registration panic on the default Prometheus registry. If both ever register a like-named metric,
prometheus.Register
returns
AlreadyRegisteredError
and the
MustNew*
helpers panic at startup. What changes were proposed in this pull request? • Construct the base
executor
scope once (
executorScope := promutils.NewScope("executor")
). • Give the webhook and plugin distinct sub-scopes derived from it:
executorScope.NewSubScope("webhook")
and
executorScope.NewSubScope("plugin")
(prefixes
executor:webhook:
and
executor:plugin:
). Scoped to webhook + plugin per the issue.
executor:storage
and
executor:catalog
already 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/...
, and
go vet ./executor/...
(all clean). CI exercises
./executor/...
. Labels • changed Setup process N/A Screenshots N/A Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs N/A Docs link N/A flyteorg/flyte