Skip to content

Fix undefined errors in metrics reports#607

Merged
daniyelnnr merged 3 commits intomasterfrom
hotfix/diagnostics
Sep 9, 2025
Merged

Fix undefined errors in metrics reports#607
daniyelnnr merged 3 commits intomasterfrom
hotfix/diagnostics

Conversation

@daniyelnnr
Copy link
Contributor

What is the purpose of this pull request?

This PR prevents undefined errors during status tracking and metrics reporting.

What problem is this solving?

Addresses a bug related to metrics tracking by ensuring that the global.metrics object is properly initialized in both master and worker processes. This is done by ensuring that it is initialized in both master and worker processes by moving its initialization into the shared startApp function in src/service/index.ts, and removing redundant initialization and type declarations from src/service/worker/index.ts.

How should this be manually tested?

One can release a version of service-runtime-node using this changes and make it available on a test cluster. Then start a store with this infrastructure and observe its pods running without CrashLoopBackOff due to Cannot read properties of undefined errors.

Screenshots or example usage

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Requires change to documentation, which has been updated accordingly.

This update introduces the MetricsAccumulator to the global scope, allowing both master and worker processes to access metrics
This change eliminates the global metrics declaration and initialization from the worker service
@daniyelnnr daniyelnnr requested review from a team and arturpimentel September 8, 2025 18:15
@daniyelnnr daniyelnnr self-assigned this Sep 8, 2025
@daniyelnnr daniyelnnr added the bug label Sep 8, 2025
@daniyelnnr daniyelnnr merged commit f6ed039 into master Sep 9, 2025
1 of 2 checks passed
@daniyelnnr daniyelnnr deleted the hotfix/diagnostics branch September 9, 2025 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants