Skip to content

WIP: Backend/enhc: added metrics fir configPilot#1335

Open
ratnadeep-99 wants to merge 1 commit into
mainfrom
Backend/enhc/config-pilot-lib-shared-kernel
Open

WIP: Backend/enhc: added metrics fir configPilot#1335
ratnadeep-99 wants to merge 1 commit into
mainfrom
Backend/enhc/config-pilot-lib-shared-kernel

Conversation

@ratnadeep-99
Copy link
Copy Markdown
Contributor

@ratnadeep-99 ratnadeep-99 commented Jun 7, 2026

Type of Change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring
  • Dependency updates

Description

Additional Changes

  • This PR modifies the database schema (database migration added)
  • This PR modifies dhall configs/environment variables

Motivation and Context

How did you test it?

Checklist

  • I formatted the code and addressed linter errors ./dev/format-all-files.sh
  • I reviewed submitted code
  • I added unit tests for my changes where possible
  • I added a CHANGELOG entry if applicable

Summary by CodeRabbit

  • Chores
    • Enhanced internal metrics infrastructure with additional configuration pilot tracking capabilities for improved system observability.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jun 7, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f86231fa-3153-460e-82ab-091f412967f2

📥 Commits

Reviewing files that changed from the base of the PR and between bfbf24d and d290618.

📒 Files selected for processing (5)
  • lib/mobility-core/src/Kernel/Mock/App.hs
  • lib/mobility-core/src/Kernel/Tools/Metrics/CoreMetrics.hs
  • lib/mobility-core/src/Kernel/Tools/Metrics/CoreMetrics/Types.hs
  • lib/mobility-core/src/Kernel/Types/Flow.hs
  • lib/mobility-core/test/src/APIExceptions.hs

Walkthrough

This PR extends the CoreMetrics system with two new Prometheus counters for tracking configuration pilot success and failure rates. The changes span type definitions, metric registration, implementation functions, and instance integrations across production, mocking, and test code paths.

Changes

Config Pilot Metrics Feature

Layer / File(s) Summary
Type definitions and metric registration
lib/mobility-core/src/Kernel/Tools/Metrics/CoreMetrics/Types.hs
Introduces ConfigPilotCounter type alias with a table_name label. Adds incrementConfigPilotSuccessCounter and incrementConfigPilotFailureCounter methods to the CoreMetrics typeclass and configPilotSuccessCounter/configPilotFailureCounter fields to CoreMetricsContainer. Updates registerCoreMetricsContainer to initialize both counters and adds registerConfigPilotSuccessCounter/registerConfigPilotFailureCounter registration functions.
Metrics implementation functions
lib/mobility-core/src/Kernel/Tools/Metrics/CoreMetrics.hs
Implements incrementConfigPilotSuccessCounter' and incrementConfigPilotFailureCounter' functions that extract the metrics container from the reader context, apply the table name label, and increment the respective Prometheus counters.
Flow integration
lib/mobility-core/src/Kernel/Types/Flow.hs
Extends the CoreMetrics instance for FlowR with the two new config pilot counter methods, delegating to the corresponding metrics implementation functions.
Mock and test stubs
lib/mobility-core/src/Kernel/Mock/App.hs, lib/mobility-core/test/src/APIExceptions.hs
Adds no-op implementations of the two new counter increment methods to CoreMetrics instances in the mock (MockM e) and test (IO) contexts.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • arjuna92

Poem

🐰 A pair of new counters hops into view,
Tracking pilot configs through and through,
Success and failure, both labeled with care,
Metrics flow smoothly through the layer-stacked air! 📊

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Title check ❓ Inconclusive The title contains a typo ('fir' instead of 'for') and uses the vague label 'WIP' suggesting incompleteness, though it does reference the actual feature (config pilot metrics). Correct the typo from 'fir' to 'for' and remove 'WIP' prefix if the PR is ready for review; otherwise clarify the work-in-progress status in the PR description.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch Backend/enhc/config-pilot-lib-shared-kernel

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot requested a review from arjuna92 June 7, 2026 22:05
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.

1 participant