-
Notifications
You must be signed in to change notification settings - Fork 812
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
feat: add the ability to set the views via the SDK constructor #3124
feat: add the ability to set the views via the SDK constructor #3124
Conversation
Does anyone have a good idea how I can access the |
Codecov Report
@@ Coverage Diff @@
## main #3124 +/- ##
==========================================
- Coverage 93.21% 93.18% -0.03%
==========================================
Files 196 196
Lines 6414 6431 +17
Branches 1350 1359 +9
==========================================
+ Hits 5979 5993 +14
- Misses 435 438 +3
|
You can access private properties using |
Thank you for the tip. I have added the unit test :) |
Sorry for the delay, this is purely a suggestion: You can also test with the resulting metric streams with a MetricReader, like adding a renaming view and checking that the metric instrument is being renamed when exported, without accessing the internal states of the meter provider. |
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 generated dts files are erasing the types of private properties. So linked packages accessing the private properties will not get the type information.
I will give it shot :) If I understand you correctly you want me to test with like the in memory exporter? |
Yeah, or more cleanly testing it with InMemoryExporter will be great. This is where InMemoryExporter is best suited :) |
@weyert what is the plan here? To update the tests to use the in memory exporter? |
If this is not ready for review please mark as draft, otherwise just comment and I will review it. |
Yes, that's the plan. I hope to sort it out before the end of the weekend. Only I am unable to switch the PR to draft |
@weyert thanks for adding this and taking the time to switch over the tests. 🚀 |
@pichlermarc I have updated the test, let me know, if this test with in memory exporter makes sense for you. If so, feel free to change the status of the PR to Ready for review :) |
Looking good, thanks for adapting the tests. 🙂 |
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.
Looks good with a few minor comments. 🙂
Sorry for the churn. 🙁
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 pending conflict resolution
Want to make sure @legendecas is happy since he had comments but this can be merged IMO |
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.
Thank you!
Which problem is this PR solving?
Recently the ability to define views has been moved to the constructor of the
MeterProvider
when you are using thenode-sdk
you aren't not able to pass views anymore. This PR attempts to resolve this problem.Fixes #3125 (issue)
Short description of the changes
Add the
views: Views[]
-parameter to the configuration typeType of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Checklist: