[metering] move usage reporting service to the usage plugin#255063
Merged
pgayvallet merged 12 commits intoelastic:mainfrom Feb 27, 2026
Merged
[metering] move usage reporting service to the usage plugin#255063pgayvallet merged 12 commits intoelastic:mainfrom
pgayvallet merged 12 commits intoelastic:mainfrom
Conversation
pgayvallet
commented
Feb 26, 2026
Comment on lines
-159
to
-162
| private async sendWithRetry(record: UsageRecord): Promise<void> { | ||
| let lastError: Error | undefined; | ||
|
|
||
| for (let attempt = 0; attempt < METERING_RETRY_ATTEMPTS; attempt++) { |
Contributor
Author
There was a problem hiding this comment.
retry logic moved to the usageReportingService
Comment on lines
+61
to
+63
| return { | ||
| usageReporting: this.usageReporting, | ||
| }; |
Contributor
Author
There was a problem hiding this comment.
Returning the service from the start contract too (given it's arguably better than consuming it from the setup contract)
Comment on lines
39
to
43
| export class UsageReportingService { | ||
| private agent: https.Agent | undefined; | ||
| private readonly config: UsageReportingConfig; | ||
| private readonly kibanaVersion: string; | ||
| private readonly logger: Logger; |
Contributor
Author
There was a problem hiding this comment.
It's a move from src/platform/plugins/shared/workflows_execution_engine/server/metering/usage_reporting_service.ts, not a delete, just too many changes because I moved the retry mechanism to the service.
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
Author
|
/ci |
Contributor
💔 Build Failed
Failed CI StepsTest Failures
Metrics [docs]
History
|
afharo
approved these changes
Feb 26, 2026
x-pack/platform/plugins/shared/usage_api/server/usage_reporting/usage_reporting_service.ts
Outdated
Show resolved
Hide resolved
x-pack/platform/plugins/shared/usage_api/server/usage_reporting/usage_reporting_service.ts
Outdated
Show resolved
Hide resolved
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.
Summary
Required for of https://github.com/elastic/search-team/issues/13010
Related to #252219 and #252434
Move the
UsageReportingServiceand related stuff from theworkflowsExecutionEngineplugin to theusageplugin, so that other consumers of the usage/metering API can re-use the type and logic