APIGOV33468 - fix remoteApiName_ prefix not stripped in metric API detail lookups - #1079
Merged
Conversation
… Azure metrics resolve subscription/product details
…teApiName_ prefix
sbolosan
requested review from
alrosca,
dfeldick,
dgghinea,
jcollins-axway and
vivekschauhan
as code owners
August 8, 2026 01:08
jcollins-axway
approved these changes
Aug 8, 2026
dgghinea
approved these changes
Aug 10, 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.
Fixes a bug where Azure (and any agent whose API ID equals its display name) traceability events showed "unknown" for Subscription, Product, ProductPlan, Quota, AssetResource, APIServiceRevision, consumer Application, api.owner, and api.apiServiceId — even when the correct AccessRequest and APIService were cached.
Root cause: ResolveIDWithPrefix falls back to prefixing the API name with remoteApiName_ when no real ID is available. Five separate cache-lookup call sites only ever stripped the remoteApiId_ prefix, never the remoteApiName_ fallback, so the lookup key never matched and every downstream field defaulted to unknown.
Adds StripSummaryEventPrefix in pkg/transaction/util/util.go, which strips both possible prefixes, and points all five affected call sites at it:
Adds table-driven test coverage for all affected sites, including the name-fallback regression case specifically:
No behavior change for any agent whose API ID never collapses to the name-fallback form (e.g. v7, webmethods) — verified live against azure-agents, webmethods-agents, and sample-agent with no regression.