Fix: Refactor Metric Collection and Reporting#28
Merged
Conversation
7587058 to
d4769ab
Compare
…e schema management
d4769ab to
13e5819
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the metric collection and reporting functionality while also simplifying database schema management and migration logic. Key changes include:
- Refactored sensor tests to align version retrieval with manifest.toml changes.
- Updated schema migration tests and adjusted expected metric formatting for service names.
- Major code reorganization in common/process_monitor.py and common/metadata_store.py to support enhanced process metrics and a simplified 5-step schema creation strategy.
Reviewed Changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_sensor.py | Updated version retrieval and constant verification to align with manifest.toml |
| tests/test_schema_migration.py | Updated expected schema version and service formatting changes |
| tests/test_process_monitor.py | Removed references to obsolete per-core CPU testing and updated process metric tests |
| tests/test_otel_connector.py | Added tests for percentage value handling and adjusted observable metric registration |
| tests/test_metadata_store.py | Updated CPU core metric formatting and metric name consistency changes |
| docs/releases/* and docs/adr/* | Updated release notes and ADRs to document refactor and schema creation improvements |
| common/process_monitor.py | Reorganized process metric collection and removed outdated per-core CPU usage calculations |
| common/otel_connector.py | Adjusted metric formatting and error logging for unsupported otel types |
| common/metadata_store.py | Simplified schema creation logic and improved database migration to version 2.0 |
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.
Description
This pull request resolves several issues related to metric collection, reporting, and formatting. It also introduces new, more detailed process metrics for enhanced monitoring. Additionally, this PR includes significant improvements to the database schema creation and migration logic.
Metric Collection and Reporting Fixes
m8mulprc/m8mulprcis now justm8mulprc)cpu_usagemetric now correctly shows the average CPU usage across all monitored processes, not the sumGauge,Counter) as defined in configurationNew Features
Database Schema Management Improvements
Technical Changes
Documentation
Testing
Checklist before requesting a review
Tag Information
Planned tag: v0.1.03