Zipkin warnings with create-react-app
See original GitHub issueI created a react app with create-react-app and when i import zipkin i get this error on start and build.
./node_modules/zipkin-transport-http/lib/HttpLogger.js
17:27-34 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
./node_modules/zipkin/lib/InetAddress.js
62:23-30 Critical dependency: require function is used in a way in which dependencies cannot be statically extracted
I put this code in App.js after all the imports. The trace is working an all the requests appear in zipkin server, but i need to clear this warnings so it passes on the pipeline.
const {
Tracer,
BatchRecorder,
jsonEncoder: {JSON_V2}
} = require('zipkin');
const CLSContext = require('zipkin-context-cls');
const {HttpLogger} = require('zipkin-transport-http');
// Setup the tracer to use http and implicit trace context
const tracer = new Tracer({
ctxImpl: new CLSContext('zipkin'),
recorder: new BatchRecorder({
logger: new HttpLogger({
endpoint: 'http://localhost:9411/api/v2/spans',
jsonEncoder: JSON_V2
})
}),
localServiceName: 'service-a' // name of this application
});
// now use tracer to construct instrumentation! For example, fetch
const wrapFetch = require('zipkin-instrumentation-fetch');
//https://randomuser.me/api
const remoteServiceName = 'randomuser.me';
const zipkinFetch = wrapFetch(fetch, {tracer, remoteServiceName});
And my package is
"zipkin": "^0.12.0",
"zipkin-context-cls": "^0.11.0",
"zipkin-instrumentation-fetch": "^0.12.0",
"zipkin-transport-http": "^0.12.0"
Issue Analytics
- State:
- Created 6 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
How to see ESlint warnings on local machine when using ...
I have a project based on create-react-app and when I run it locally I get zero ESlint warnings or errors, that's when running...
Read more >OpenZipkin · A distributed tracing system
Zipkin. Zipkin is a distributed tracing system. It helps gather timing data needed to troubleshoot latency problems in service architectures.
Read more >Tracing NodeJS Services with Open Telemetry - Alan Storm
In the first two articles in this series we took a crash course in instrumenting a small three service system using Zipkin.
Read more >Advanced Configuration - Create React App
Variable Development Production
BROWSER ✓ Used 🚫 Ignored
BROWSER_ARGS ✓ Used 🚫 Ignored
HOST ✓ Used 🚫 Ignored
Read more >Grafana date format - Allevamento di Casa Lopresti
Understand all of your metrics with dashboards that are easy to create and ... source that can read log files. c – Getting...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@DavideCarvalho would you be able to open a PR with a fix or with a test case?
Maybe we should use some kind of bundler for the zipkin packages, so it can tree shake some of the deps. zipkin-transport-http is giving warnings because of peer deps.