0

I would like to know if it is possible to modify iron-ajax somehow to use cujojs-rest to perform all the requests. I would like to use cujojs-rest zipkin instrumentation for tracing in my app.

Here is an example app using cujojs-rest zipkin instrumentation to generate trace data for Zipkin: wingtips-cujojs-spark-example

So let's say I have got code like this:

const {Tracer, BatchRecorder, ExplicitContext} = require('zipkin');
const {HttpLogger} = require('zipkin-transport-http');
const {restInterceptor} = require('zipkin-instrumentation-cujojs-rest');

const rest = require('rest');

const ctxImpl = new ExplicitContext();
const recorder = new BatchRecorder({
    logger: new HttpLogger({
        endpoint: 'http://localhost:9411/api/v1/spans'
    })
});

const tracer = new Tracer({ctxImpl, recorder});
const nameOfRemoteService = 'cujojs-client';
const client = rest.wrap(restInterceptor, {tracer, serviceName: nameOfRemoteService});

client({
    method: 'GET',
    path: 'http://localhost:9999/request'
}).then(function(response) {
    console.log('response: ', response);
});

I would like to achieve the same in iron-ajax

jpiechowka
  • 75
  • 1
  • 12
  • You could try creating your own custom element similar to `iron-ajax` that handled these requests? – Ben Thomas Aug 19 '16 at 09:12
  • I don't have much experience in this field, but it looks that I will need to rewrite Iron-ajax or write my own element. – jpiechowka Aug 22 '16 at 08:40

0 Answers0