Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jaeger back end isn't recieving any data (using Jager Node.js client)

I'm trying to get a little example of Jaeger working using Node.js, but I can't get the Jaeger UI to display any data or show anything.

I have read this question: uber/jaeger-client-node: backend wont receive data but this hasn't helped in my case.

I'm running the Jaeger back end in a docker container using:

docker run -d -e COLLECTOR_ZIPKIN_HTTP_PORT=9411 -p5775:5775/udp -p6831:6831/udp -p6832:6832/udp -p5778:5778 -p16686:16686 -p14268:14268 -p9411:9411 jaegertracing/all-in-one:latest

The code for my example is:

var initTracer = require('jaeger-client').initTracer;

// See schema https://github.com/jaegertracing/jaeger-client-node/blob/master/src/configuration.js#L37
var config = {
  'serviceName': 'my-awesome-service'
};
var options = {
  'tags': {
    'my-awesome-service.version': '1.1.2'
  }
  //'metrics': metrics,
  //'logger': logger
};
var tracer = initTracer(config, options);

const express = require('express');
const app = express();

// Handle a GET request on the root path
app.get('/', (req, res) => {
    const span = tracer.startSpan('http_request');
    res.send('Hello Jaeger');
    span.log({'event': 'request_end'});
    span.finish();
});

// Set up server
const server = app.listen(8000, () => {
    let host = server.address().address;
    let port = server.address().port;

    console.log('Service_1 listening at http://%s:%s', host, port);
});

Any help as to what I am doing wrong would be much appreciated!

like image 790
ChilledPanda Avatar asked Oct 28 '22 22:10

ChilledPanda


1 Answers

You need to add some more properties to your config options. For reporter deployed on localhost and local sampler strategy :

var config = {
  'serviceName': 'my-awesome-service',
  'reporter': {
    'logSpans': true,
    'agentHost': 'localhost',
    'agentPort': 6832
  },
  'sampler': {
    'type': 'probabilistic',
    'param': 1.0
  }
};

Replace localhost by server or route name to target another host for Jeager runtime.

like image 65
lbroudoux Avatar answered Nov 08 '22 06:11

lbroudoux