APIGOV-33152 - Fall back to API name in metric/transaction events#1057
Draft
sbolosan wants to merge 2 commits into
Draft
APIGOV-33152 - Fall back to API name in metric/transaction events#1057sbolosan wants to merge 2 commits into
sbolosan wants to merge 2 commits into
Conversation
jcollins-axway
approved these changes
Jul 8, 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.
Per the v3 metric event spec, data.api.id must use remoteApiId_ only when a dataplane API's remoteAPIID is actually resolvable, and remoteApiName_ when it falls back to the display name. ResolveIDWithPrefix in pkg/transaction/util/util.go only ever emitted remoteApiId_, even in the name-fallback case — confirmed in production on an Azure metric event where api.id showed remoteApiId_cat-fact-api, even though cat-fact-api is the API's name, not a resolvable ID.
Changes
Add SummaryEventAPINamePrefix = "remoteApiName_" constant (util.go, re-exported from definitions.go alongside the existing SummaryEventProxyIDPrefix)
ResolveIDWithPrefix now emits remoteApiName_ when the ID is empty/just the prefix and a name is available. The both-empty case is unchanged (remoteApiId_unknown)
Extended the code to also catch the case where an already-prefixed ID's content is identical to the name (e.g. remoteApiId_cat-fact-api / name cat-fact-api). A genuinely resolvable ID and a display name are normally different values, so an exact match means the caller (e.g. Azure's traceability path, or Apigee's product-metric path) blindly prefixed the display name as if it were a resolvable ID. This corrects the output centrally, without requiring changes in any agent repo.