Skip to content

APIGOV-33152 - Fall back to API name in metric/transaction events#1057

Draft
sbolosan wants to merge 2 commits into
mainfrom
APIGOV-33152
Draft

APIGOV-33152 - Fall back to API name in metric/transaction events#1057
sbolosan wants to merge 2 commits into
mainfrom
APIGOV-33152

Conversation

@sbolosan

@sbolosan sbolosan commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants