Skip to content

Add custom metrics to micrometer#474

Draft
qligier wants to merge 3 commits into
mainfrom
feat/metrics
Draft

Add custom metrics to micrometer#474
qligier wants to merge 3 commits into
mainfrom
feat/metrics

Conversation

@qligier
Copy link
Copy Markdown
Member

@qligier qligier commented Feb 23, 2026

No description provided.

@qligier qligier requested a review from Copilot February 23, 2026 19:02
@qligier qligier self-assigned this Feb 23, 2026
@qligier qligier added the enhancement New feature or request label Feb 23, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request adds custom metrics to Micrometer for monitoring Matchbox server operations. It introduces a new metrics infrastructure to track validation and transformation operations, along with a refactoring of the engine caching mechanism.

Changes:

  • Introduces MatchboxMetrics class to expose validation count, validation duration, and transformation count metrics via Micrometer
  • Refactors EngineSessionCache into MatchboxEngineCache with improved separation of permanent vs. transient engines
  • Adds count() methods to ImplementationGuideProvider implementations to expose the number of installed IGs as a metric
  • Updates CliContext to provide a sessionId() method for consistent session identification

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
matchbox-server/src/main/java/ch/ahdis/matchbox/util/metrics/MatchboxMetrics.java New class that defines custom Micrometer metrics for validations and transformations
matchbox-server/src/main/java/ch/ahdis/matchbox/config/MatchboxMetricsConfig.java New Spring configuration that registers metrics beans and exposes engine/IG counts
matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineCache.java New cache implementation replacing EngineSessionCache with better separation of permanent and transient engines
matchbox-server/src/main/java/ch/ahdis/matchbox/util/EngineSessionCache.java Deleted file, replaced by MatchboxEngineCache
matchbox-server/src/main/java/ch/ahdis/matchbox/validation/ValidationProvider.java Updated to collect validation metrics using MatchboxMetrics
matchbox-server/src/main/java/ch/ahdis/matchbox/validation/gazelle/GazelleValidationWs.java Updated to collect validation metrics via constructor-injected MatchboxMetrics
matchbox-server/src/main/java/ch/ahdis/matchbox/mappinglanguage/StructureMapTransformProvider.java Updated to collect transformation metrics using MatchboxMetrics
matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineSupport.java Refactored to use MatchboxEngineCache instead of EngineSessionCache, improving session ID handling
matchbox-server/src/main/java/ch/ahdis/matchbox/CliContext.java Added sessionId() method to encapsulate session ID generation logic
matchbox-server/src/main/java/ch/ahdis/matchbox/packages/MatchboxImplementationGuideProvider.java Added count() method interface for tracking installed IGs
matchbox-server/src/main/java/ch/ahdis/matchbox/packages/ImplementationGuideProviderR5.java Implemented count() method to expose IG count metric
matchbox-server/src/main/java/ch/ahdis/matchbox/packages/ImplementationGuideProviderR4B.java Implemented count() method to expose IG count metric
matchbox-server/src/main/java/ch/ahdis/matchbox/packages/ImplementationGuideProviderR4.java Implemented count() method to expose IG count metric
matchbox-server/src/main/java/ch/ahdis/matchbox/config/MatchboxJpaConfig.java Updated to create and inject MatchboxEngineCache bean
matchbox-server/src/main/java/ca/uhn/fhir/jpa/starter/Application.java Added MatchboxMetricsConfig to Spring configuration imports

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread matchbox-server/src/main/java/ch/ahdis/matchbox/util/metrics/MatchboxMetrics.java Outdated
Comment thread matchbox-server/src/main/java/ch/ahdis/matchbox/util/MatchboxEngineCache.java Outdated
@qligier
Copy link
Copy Markdown
Member Author

qligier commented Feb 25, 2026

Memory consumption seems to have increased, I need to investigate.

@qligier qligier marked this pull request as draft February 25, 2026 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants