Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a critical bug in metric type enforcement by implementing proper OpenTelemetry type handling with strict TOML compliance and a database-driven metric registry. Key changes include a unified create_observable() method, syncing TOML definitions to a persistent database, and enhanced testing and documentation updates.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/test_otel_connector.py | Updated tests to validate the rejection of undefined metrics and proper conversion of numeric strings. |
| docs/releases/TAG_v0.1.02.md | Updated release documentation to reflect new architecture and metric type enforcement. |
| docs/releases/RELEASE_NOTES.md | Expanded release notes outlining the bug fix and architectural improvements. |
| common/otel_connector.py | Refactored to introduce unified metric creation and database-driven observable metrics registration. |
| common/metadata_store.py | Added methods to sync TOML definitions and manage obsolete metrics in the database. |
| common/manifest.toml | Bumped version to 0.1.02 reflecting metric type enforcement changes. |
…dling v0.1.02
- Fix critical issue where all metrics appeared as GAUGE in Instana
- Add unified create_observable() method respecting TOML otel_type config
- Implement 'register once, read many' architecture with database sync
- Remove dynamic metric registration for strict TOML compliance
- Support proper Gauge/Counter/UpDownCounter types from manifest.toml
- Add missing MetadataStore methods: sync_metric_from_toml, get_service_metrics
- Update RELEASE_NOTES.md with comprehensive v0.1.02 documentation
- Update test_otel_connector.py to test new architecture and unified methods
- Fix string number conversion: Replace isdigit() with try/except float()
- Now handles both integer strings ('85') and decimal strings ('10.5')
- Version bump to v0.1.02
VERIFIED WORKING:
- TOML sync to database: 'Successfully synced TOML metrics to database'
- Database metric loading: 'Loaded 20 metrics from database registry'
- Proper metric registration: 'Registered 20 observable metrics from database'
- Strict validation: Rejects undefined metrics with proper warnings
- String conversion: Handles '10.5' and '85' correctly
Addresses Copilot feedback from PR #27
Affects all Strategy₿ plugins: m8mulprc, m8prcsvr, m8refsvr, mstrsvr
e1885f2 to
865e90f
Compare
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
Fix critical issue where all metrics appeared as GAUGE in Instana despite manifest.toml configuration specifying different OpenTelemetry types. This implementation ensures proper type enforcement (Gauge, Counter, UpDownCounter) and strict TOML compliance.
Key Changes:
create_observable()method respectingotel_typefrom manifest.tomlotel_typecolumn and missing methodsVerification Results:
✅ Successfully synced TOML metrics to database
✅ Loaded 20 metrics from database registry
✅ Registered 20 observable metrics from database
✅ Proper rejection of undefined metrics with warnings
Impact:
Affects all Strategy₿ plugins: m8mulprc, m8prcsvr, m8refsvr, mstrsvr
Checklist before requesting a review
Tag Information
Planned tag: v0.1.02