-
Notifications
You must be signed in to change notification settings - Fork 438
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add OpenTelemetry Meter API #162
Conversation
And change type to A/SynchronousInstrument
And change ptr type to A/SynchronousInstrument
Also added comments
I have updated the meter class to address some feedback left on this PR and to improve integration with other metrics classes. It is ready to re-review. NOTE: |
I could not get the counter upcasting to work correctly for some reason.
Replace overloaded RecordBatch functions.
Note that this is definitely not ideal for users. Making this function more user-friendly is a potential future enhancement to our code.
Hello all, I have updated the Meter class to remove the need to use dynamic_pointer_cast. However, this requires working with raw pointers in the RecordBatch function. This is not ideal but it is required due to limitations of nostd::shared_ptr. This PR does not currently pass CI tests due to an issue in the MeterProvider class that was already merged. However, once that is fixed this PR will be ready to merge, pending final approval. |
This is necessary because the MeterProvider class (that is already merged into the repo) instantiates this class and the Meter SDK stub in the repo will have unimplemented pure virtual functions if this PR is merged. This stub will be updated with the actual header when the Meter SDK class is merged (pending approval in PR #212).
Codecov Report
@@ Coverage Diff @@
## master #162 +/- ##
==========================================
- Coverage 94.22% 92.19% -2.04%
==========================================
Files 115 117 +2
Lines 3882 4038 +156
==========================================
+ Hits 3658 3723 +65
- Misses 224 315 +91
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
@reyang I believe this PR is ready to merge :) |
I am working on implementing the metrics API and SDK for C++. This is one of a series of PRs I plan to file along with @ankit-bhargava and @HudsonHumphries.
This is a cut at implementing the API's Meter Class defined in the specification. This class provides functions to create and return all metric instrument types. It also provides a function to record to a batch of instruments in a single API call.
I have also included the default no-op implementation of the meter class in metrics/noop.h. The default no-op MeterProvider will instantiate this class. This class is only capable of creating and returning no-op metric instruments.
Lastly, I have included a no-op meter test. This is similar to the no-op tracer test and checks that there are no errors when creating metric instruments and calling BatchRecord.
Note: This PR does not currently build. The exact reason why is listed in the review section below.