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.
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
Meter provider api #39
Meter provider api #39
Changes from 9 commits
40ecc12
1773af8
ac793c5
a0777dd
ec00310
3af790a
8268a15
f9b7c45
39e01fa
a630aa7
fd75583
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Calling the base class constructor and assigning directly to CppMeterProvider is redundant. The base class constructor already assigns to CppMeterProvider. I think you can leave out CppMeterProvider(mp) here on this line
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.
Originally I left out the CppMeterProvider(mp) from this line, but after merging with Rick's code it caused a crash. I had to add it back in or else the "addMetricReader" would cause a crash. Should I find another way to fix that crash instead?
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.
If it is causing a crash, we need to understand why. CppMeterProvider(mp) here should be completely redundant. I think we should remove it, find out if it is really crashing, and if so, determine why.
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.
Ok I will look into this, thanks.
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.
I don't think you need "Delta" temporality here. I would just call the exporter constructor with no input and use the default temporality.
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.
For some reason after implementing all these changes and running the tests, all the tracer tests which are run after the metrics tests fail. I added the Delta temporality back in, and the tracer tests are now passing again. Do you know why that could be happening?
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.
How did the tests fail? What are the error messages?
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.
The resourceSpan error is unrelated. I think currently it is a sporadic error depending on the run. The reason why it is happening is that even when we do "clear mp" before readJsonResults, we are still not stopping the MeterProvider from regularly exporting. The MeterProvider mp contains a shared pointer that points to the cpp MeterProvider object. But that cpp MeterProvider object is also pointed to by the global MeterProvider with a shared pointer. As long as there is at least one shared pointer pointing to it, the cpp MeterProvider is not getting destroyed.
After the metric tests are completed and when the tracing tests are running, the collector is getting data from both metrics and tracing. Depending on the timing, the tracing tests sometimes pick up the metric results, and the metric results doesn't have the resourceSpan field.
So we need to figure out how to deal with this larger issue. But that can be after your PR gets accepted. I would recommend you can continue to remove the "delta" temporality. If the tests fail, we can ignore for now, and deal with it after.
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.
Ok sounds good thanks. I deleted my earlier comment about the error with tcontextPropagation because that was just caused by a typo so that's fine.
I just confirmed by testing a few times that the resourceSpan error does seem to occur when the "delta" temporality is removed, and the error goes away when I add it back. I'm not sure what the connection is there, but I can still remove the "delta" temporality if you'd like.