APIGOV-33237 - value none or unknown instead of dropping metric fields that are blank or nil #1062
Open
sbolosan wants to merge 5 commits into
Open
APIGOV-33237 - value none or unknown instead of dropping metric fields that are blank or nil #1062sbolosan wants to merge 5 commits into
sbolosan wants to merge 5 commits into
Conversation
sbolosan
requested review from
alrosca,
dfeldick,
dgghinea,
jcollins-axway and
vivekschauhan
as code owners
July 17, 2026 01:28
…al resource validation
vivekschauhan
previously approved these changes
Jul 17, 2026
dgghinea
previously approved these changes
Jul 17, 2026
alrosca
previously approved these changes
Jul 17, 2026
jcollins-axway
previously approved these changes
Jul 17, 2026
sbolosan
dismissed stale reviews from jcollins-axway, alrosca, dgghinea, and vivekschauhan
via
July 18, 2026 04:57
b21ecb4
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.
Several fields in the metric event (subscription, application, product, marketplace, quota, etc.) used to just disappear from the JSON entirely whenever the agent couldn't fully identify which app, subscription, or product a transaction belonged to, instead of showing up with a clear "we don't know" value.
Now, those fields always show up in the event, populated with either the real value when it's known, or a standard placeholder when it isn't. Now downstream systems can always count on the field being there.
Also fixed a bug where, if the agent found the app/subscriber but not the specific access grant tied to that API call, it was throwing away the app info it did have and blanking out everything — now it keeps whatever it successfully found.
Separately, fixed the API name/ID field so it correctly says "this is a name" vs. "this is a real ID" instead of always claiming it had a real ID even when it was really just guessing based on the name.
Directly backed by the AHurst confluence spec text for metrics:
application.id, subscription.id, product.id/versionId, api.apiServiceId, apiServiceRevision.id, assetResource.id, productPlan.id, units..quota.id — all documented as | "unknown" only, no "none" option.
application.consumerOrgId and marketplace.consumerOrgId — documented as | "none" only, with the spec's own text: "'none' indicates that it is not a marketplace context event and a consumer org does not apply."
marketplace.guid — documented as | "none" | "unknown", with explicit text: "'none' indicates that the event is outside the context of a marketplace... 'unknown' indicates the marketplace could not be determined. Should be avoided unless the information is not available at all."
product.owner.type — documented as conditionally required: "When data.product.id is not 'unknown'".
application.owner.type / api.owner.type — documented as "team"|"user"|"none"|"unknown" (application) and "team"|"none"|"unknown" (api), with the spec noting "'unknown' is only valid for upgraded events and means the owner could not be determined."