Skip to content

Write apiProductId to gateway metrics and log in SubscriptionProcessor and ReporterProcessor#16340

Merged
carlos-andres-osorio merged 3 commits intomasterfrom
apim-13543
Apr 15, 2026
Merged

Write apiProductId to gateway metrics and log in SubscriptionProcessor and ReporterProcessor#16340
carlos-andres-osorio merged 3 commits intomasterfrom
apim-13543

Conversation

@carlos-andres-osorio
Copy link
Copy Markdown
Contributor

@carlos-andres-osorio carlos-andres-osorio commented Apr 10, 2026

Issue

https://gravitee.atlassian.net/browse/APIM-13544

Changes

  • SubscriptionProcessor: writes apiProductId to Metrics when subscription.getApiProductId() is non-null
  • ReporterProcessor: forwards apiProductId from Metrics to the Log object before reporting, so it appears in all v4 access log entries (Elasticsearch, File/CSV)

Without the second fix, apiProductId is always null in Log regardless of whether the request goes through an API product plan.

Testing

  • SubscriptionProcessorTest: product subscription path sets apiProductId on metrics; direct API subscription leaves it null
  • ReporterProcessorTest: non-null metrics.getApiProductId() is propagated to the reported Log

For manual testing details, see description in #16394

@carlos-andres-osorio carlos-andres-osorio self-assigned this Apr 10, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the gravitee-reporter-api.version in the pom.xml file from 2.1.0 to 2.2.0. I have no feedback to provide.

@carlos-andres-osorio carlos-andres-osorio changed the title chore: bump gravitee-reporter-api to 2.2.0 feat: write apiProductId to gateway analytics metrics Apr 10, 2026
@carlos-andres-osorio carlos-andres-osorio changed the title feat: write apiProductId to gateway analytics metrics Write apiProductId to gateway analytics metrics Apr 13, 2026
@carlos-andres-osorio carlos-andres-osorio marked this pull request as ready for review April 13, 2026 18:04
@carlos-andres-osorio carlos-andres-osorio requested a review from a team as a code owner April 13, 2026 18:04
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@carlos-andres-osorio carlos-andres-osorio marked this pull request as draft April 14, 2026 20:05
@carlos-andres-osorio carlos-andres-osorio changed the title Write apiProductId to gateway analytics metrics Write apiProductId to gateway metrics and log in SubscriptionProcessor and ReporterProcessor Apr 14, 2026
Why: The new version adds apiProductId to Metrics and Log, which is required by APIM-13544 and APIM-13546 to write and index API product context in gateway analytics.
Why: API product context was already resolved from the subscription
but never forwarded to Metrics, making it invisible in analytics
dashboards. Reporters now receive the product ID on every request
made through an API product plan.
@sonarqubecloud
Copy link
Copy Markdown

@carlos-andres-osorio carlos-andres-osorio marked this pull request as ready for review April 14, 2026 20:50
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@carlos-andres-osorio carlos-andres-osorio merged commit 71d5a79 into master Apr 15, 2026
48 checks passed
@carlos-andres-osorio carlos-andres-osorio deleted the apim-13543 branch April 15, 2026 13:17
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