opentelemetry-cpp
opentelemetry-cpp copied to clipboard
[WIP] Fix metrics context circular reference
trafficstars
Fixes #1534 (issue)
Changes
Please provide a brief description of the changes here.
For significant contributions please make sure you have completed the following items:
- [ ]
CHANGELOG.mdupdated for non-trivial changes - [ ] Unit tests have been added
- [ ] Changes in public API reviewed
Codecov Report
Merging #1535 (a4052af) into main (86c9f2b) will decrease coverage by
0.57%. The diff coverage is43.59%.
@@ Coverage Diff @@
## main #1535 +/- ##
==========================================
- Coverage 83.85% 83.28% -0.56%
==========================================
Files 156 156
Lines 4908 4970 +62
==========================================
+ Hits 4115 4139 +24
- Misses 793 831 +38
| Impacted Files | Coverage Δ | |
|---|---|---|
| sdk/src/metrics/meter.cc | 4.80% <0.00%> (-0.46%) |
:arrow_down: |
| sdk/src/metrics/state/observable_registry.cc | 14.29% <0.00%> (-0.86%) |
:arrow_down: |
| sdk/src/metrics/sync_instruments.cc | 79.24% <55.77%> (-16.00%) |
:arrow_down: |
| sdk/src/metrics/state/metric_collector.cc | 48.00% <66.67%> (-2.00%) |
:arrow_down: |
| sdk/src/metrics/meter_context.cc | 42.86% <100.00%> (ø) |
@esigo - I have gone through the circular reference between meter_context <-> meter, and meter_context <-> metric_collector, and I don't think it would be easy to avoid them. These changes look good in that scenario. We can have a separate issue to track the redesign requirement for metrics v1.0 / GA.