Skip to content
This repository has been archived by the owner on May 5, 2022. It is now read-only.

If an application is also making HTTP requests they seem to be nested when they shouldn't be #40

Open
sjanuary opened this issue Aug 13, 2018 · 0 comments · May be fixed by #44
Open

If an application is also making HTTP requests they seem to be nested when they shouldn't be #40

sjanuary opened this issue Aug 13, 2018 · 0 comments · May be fixed by #44

Comments

@sjanuary
Copy link
Member

This is my sample app:

require('appmetrics-zipkin')({
  host: 'localhost',
  port: 9411,
  serviceName:'frontend',
  sampleRate: 1.0
});

var http = require('http');

const port = 3000;

const requestHandler = (request, response) => {  
  response.end('Hello')
}

const server = http.createServer(requestHandler);

server.listen(port, (err) => {  
  if (err) {
    return console.log('An error occurred', err)
  }
  console.log(`Server is listening on ${port}`)
});

setInterval(function() {
  try {
  	http.get('http://localhost:3000/')
  } catch (err) {
  	console.log("caught error");
  	console.error(err);
  }
}, 3000);

It is making HTTP calls, but not from within the scope of the HTTP request handler so I don't think the outbound call should be nested inside the incoming call. In OpenZipkin we see this however:

zipkin

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant