<#7229 [V2] Expand contextutils with org, service_...
# flyte-github
a
#7229 [V2] Expand contextutils with org, service_name, cluster_id keys and logKeys Pull request opened by SVilgelm Why are the changes needed? The shared interceptor chain in Union Cloud sets context values using v1
contextutils.Key
types, but v2 services (actions, leaseworker, leasor, events-proxy, executorv2) use the v2 logger which reads v2
contextutils.Key
. Both are
type Key string
but are different Go types —
context.Value()
requires exact type match, so all context-propagated log fields (x-request-id, exec_id, org, project, domain, etc.) are missing from v2 service logs. What changes were proposed in this pull request? • Add three new constants to v2 `contextutils`:
OrganizationKey
(
"org"
),
ServiceNameKey
(
"service_name"
),
ClusterNameKey
(
"cluster_id"
) • Expand
logKeys
array with 5 entries:
ProjectKey
,
DomainKey
,
OrganizationKey
,
ServiceNameKey
,
ClusterNameKey
• This ensures
GetLogFields()
includes these fields in structured log output This is one half of the fix — the other half is a v1→v2 context bridge interceptor in the cloud repo that copies v1 values onto v2 keys at request time. How was this patch tested? • Expanded
TestGetFields
to verify all new keys appear in
GetLogFields()
output • All existing tests pass Labels • changed: Expands v2 contextutils log key coverage • All new and existing tests passed. • All commits are signed-off. 🤖 Generated with Claude Code •
main
• #6583 • [V2] Expand contextutils with org, service_name, cluster_id keys and logKeys 👈 flyteorg/flyte