[SDK] View should not have a unit#3552
Merged
marcalff merged 3 commits intoopen-telemetry:mainfrom Jul 28, 2025
Merged
Conversation
✅ Deploy Preview for opentelemetry-cpp-api-docs canceled.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3552 +/- ##
==========================================
- Coverage 90.03% 90.02% -0.01%
==========================================
Files 220 220
Lines 7069 7069
==========================================
- Hits 6364 6363 -1
- Misses 705 706 +1
🚀 New features to boost your workflow:
|
Member
Author
There was a problem hiding this comment.
Pull Request Overview
This PR removes the unit parameter from the View class and ViewFactory methods to address issue #3547. This is a breaking change that simplifies the View interface by eliminating the unit field that was apparently not needed.
- Removed the
unitmember variable from the View class - Removed the
unitparameter from all ViewFactory::Create() method overloads - Updated all test files and examples to use the new API without unit parameters
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/include/opentelemetry/sdk/metrics/view/view.h | Removed unit member variable and constructor parameter from View class |
| sdk/include/opentelemetry/sdk/metrics/view/view_factory.h | Removed unit parameter from ViewFactory::Create method signatures |
| sdk/src/metrics/view/view_factory.cc | Updated ViewFactory::Create implementations to remove unit parameter handling |
| sdk/test/metrics/sum_aggregation_test.cc | Updated test cases to use new View constructor without unit parameter |
| sdk/test/metrics/meter_test.cc | Updated test case to use new View constructor without unit parameter |
| sdk/test/metrics/histogram_test.cc | Updated test cases to use new View constructor without unit parameter |
| sdk/test/metrics/histogram_aggregation_test.cc | Updated test case to use new View constructor without unit parameter |
| sdk/test/metrics/histogram_aggregation_benchmark.cc | Updated benchmark to use new View constructor without unit parameter |
| examples/prometheus/main.cc | Updated example to use new ViewFactory::Create without unit parameter |
| examples/otlp/grpc_metric_main.cc | Updated example to use new ViewFactory::Create without unit parameter |
| examples/metrics_simple/metrics_ostream.cc | Updated example to use new ViewFactory::Create without unit parameter |
| CHANGELOG.md | Added entry documenting the breaking change |
malkia
added a commit
to malkia/opentelemetry-cpp
that referenced
this pull request
Jul 28, 2025
[SDK] View should not have a unit (open-telemetry#3552)
1 task
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.
Fixes #3547
Changes
Please provide a brief description of the changes here.
unitmember from classViewunitparameter fromViewFactory::Create()methodsFor significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes