すべてのリクエストを実行するためにiron-ajax
何らかの方法で変更できるかどうかを知りたいです。cujojs-rest
アプリでのトレースに cujojs-rest zipkin インストルメンテーションを使用したいと考えています。
以下は、cujojs-rest zipkin インストルメンテーションを使用して Zipkin のトレース データを生成するアプリの例です: wingtips-cujojs-spark-example
だから私はこのようなコードを持っているとしましょう:
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);
});
私は同じことを達成したいと思いますiron-ajax