close
Skip to content
This repository was archived by the owner on May 5, 2022. It is now read-only.
This repository was 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

@sjanuary

Description

@sjanuary

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions