question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Zipkin warnings with create-react-app

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jcchavezscommented, Oct 17, 2018

@DavideCarvalho would you be able to open a PR with a fix or with a test case?

0reactions
DavideCarvalhocommented, Oct 19, 2018

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. image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found