Skip to content

Inject MetricsPersistence directly into PersistingMetricsReporter#4866

Merged
dimas-b merged 4 commits into
apache:mainfrom
dimas-b:fix-MetricsPersistence-inject
Jun 26, 2026
Merged

Inject MetricsPersistence directly into PersistingMetricsReporter#4866
dimas-b merged 4 commits into
apache:mainfrom
dimas-b:fix-MetricsPersistence-inject

Conversation

@dimas-b

@dimas-b dimas-b commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

This is a rebased version of #4708 from @bowsii (plus conflict resolutions)

Fixes #4655

  1. Added a CDI producer for MetricsPersistence in ServiceProducers.

  2. Removed CallContext dependency from PersistingMetricsReporter.

  3. Removed PolarisMetaStoreManager dependency from
    PersistingMetricsReporter.

  4. Injected MetricsPersistence directly into
    PersistingMetricsReporter.

  5. Replaced:
    metaStoreManager.writeScanMetrics(...)
    with:
    metricsPersistence.writeScanReport(...)

  6. Replaced:
    metaStoreManager.writeCommitMetrics(...)
    with:
    metricsPersistence.writeCommitReport(...)

  7. Updated Javadocs to reflect direct MetricsPersistence usage.

  8. Refactored PersistingMetricsReporterTest:

    • Removed CallContext mocks.
    • Removed PolarisMetaStoreManager mocks.
    • Added MetricsPersistence mock.
    • Updated verifications to use
      writeScanReport() and writeCommitReport().

Checklist

  • 🛡️ Don't disclose security issues! (contact security@apache.org)
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@snazy snazy left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

I wonder whether PolarisEventManager would be the next one?

@github-project-automation github-project-automation Bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Jun 26, 2026
@dimas-b dimas-b merged commit cdb4dcd into apache:main Jun 26, 2026
24 checks passed
@github-project-automation github-project-automation Bot moved this from Ready to merge to Done in Basic Kanban Board Jun 26, 2026
@dimas-b dimas-b deleted the fix-MetricsPersistence-inject branch June 26, 2026 18:20
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.

Improve MetricsPersistence injection

3 participants