Comments (7)
Do you call MeterProvider.shutdown()
when the tests are done?
Which platform are you running on?
from opentelemetry-js.
@pichlermarc Do you call MeterProvider.shutdown() when the tests are done? >>> NO
Which platform are you running on? >>> i am running on my localhost(macbook). i run yarn test on my project after integrating metrics sdk. As i still did not write any test cases for metrics then why my project existing test suite is braking by just integrating metrics api.
I tried this as well, did not work for me -> #3723 (comment)
from opentelemetry-js.
@pichlermarc can you please help in identify this issue. As i could not make out if this issue coming from metrics library or is there something wrong i am doing it.
from opentelemetry-js.
The reason is that we currently don't set the browser overrides in a way that jest can deal with them, it only works for webpack and some other bundlers.
See
So it's not something you're doing wrong, but testing in jest like this is a case we currently don't support. That being said #4543 is now up-for-grabs in case someone has cycles to work on it.
from opentelemetry-js.
thank you so much for help @pichlermarc
this issue is resolved by mocking metircs library in jest setupTest file, which is root file of jest
jest.mock('@opentelemetry/sdk-metrics');
BTW in the future upcoming versions, can this error go away without mocking metrics library.
from opentelemetry-js.
I believe this can be closed in favor of #4543
from opentelemetry-js.
BTW in the future upcoming versions, can this error go away without mocking metrics library.
@iemjitendra, yes we hope to address this with #4543, which should take care of that. I'll close this issue as duplicate for now as the other one is more explicit about what we need to do.
from opentelemetry-js.
Related Issues (20)
- add bundler tests HOT 3
- Semantic Conventions Update Options HOT 8
- Types returned by getMeter are not compatible HOT 4
- Consider adding optional fields and functions in Interfaces to avoid breaking changes in minor version updates
- Custom context manager not respected when span processors / exporters are configured via env vars HOT 1
- registerInstrumentations uses the global provider instead of the one passed in HOT 7
- Not able to run Unit Tests
- [sdk-trace] make `resource` private in `BasicTracerProvider`
- [sdk-trace] make `activeSpanProcessor` private
- Wrong import for "OTLPExporterNodeBase" HOT 4
- Support "using" pattern in TS HOT 1
- [instrumentation-http] unable to update span name or add a parent span to handle rpc distinction from http spans HOT 2
- NodeSDK. Attempted duplicate registration of API context, propagation and trace HOT 3
- Align http and undici metric name HOT 2
- traces of resource detectors being sent
- Missing active context in the Prisma event listener HOT 1
- Nestjs istio context propagation is not working as expected
- Implement npm provenance statements for released artifacts
- Widen peerDependency range for `@opentelemetry/api`
- Bundle size too large for js-web HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opentelemetry-js.