tracer.letId(id, () => { tracer.recordAnnotation(new Annotation.ClientSend()); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: remoteServiceName, host: new InetAddress(this.host), port: this.port.toString() })); tracer.recordRpc(`query ${this.database}`); });
_recordRequest(proxyReq) { this.tracer.recordServiceName(this.serviceName); this.tracer.recordRpc(proxyReq.method.toUpperCase()); this.tracer.recordBinary('http.path', getPathnameFromPath(proxyReq.path)); this.tracer.recordAnnotation(new Annotation.ClientSend()); if (this.remoteServiceName) { this.tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: this.remoteServiceName, port: parseInt(proxyReq.port) })); } }
const recordProducerStart = (tracer, name, remoteServiceName, {topic}) => { tracer.setId(tracer.createChildId()); const traceId = tracer.id; tracer.recordServiceName(tracer.localEndpoint.serviceName); tracer.recordRpc(name); tracer.recordBinary('kafka.topic', topic); if (typeof remoteServiceName !== 'undefined') { tracer.recordAnnotation(new Annotation.ServerAddr({serviceName: remoteServiceName})); } tracer.recordAnnotation(new Annotation.ProducerStart()); return traceId; }
function commonAnnotations(rpc) { tracer.recordRpc(rpc); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordAnnotation(new Annotation.ServerAddr(sa)); tracer.recordAnnotation(new Annotation.ClientSend()); }
/** * Records start of RPC request * @param {grpc.Metadata} metadata * @param {string} method * @return {zipkin.TraceId} */ start(metadata, method) { const traceId = this.tracer.createChildId(); this.tracer.letId(traceId, () => { this.tracer.recordServiceName(this.serviceName); this.tracer.recordRpc(method); this.tracer.recordAnnotation(new Annotation.ClientSend()); if (this.remoteServiceName) { this.tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: this.remoteServiceName })); } }); return traceId; }
function mkZipkinCallback(callback, id) { var originalId = tracer.id; return function zipkinCallback() { var _this = this; for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { args[_key] = arguments[_key]; } tracer.letId(id, function () { var error = args[0]; if (error) { tracer.recordBinary('error', error.message || String(error)); } // TODO: parse host and port from details in callback // https://github.com/3rd-Eden/memcached#details-object tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: remoteServiceName })); tracer.recordAnnotation(new Annotation.ClientRecv()); }); // callback runs after the client request, so let's restore the former ID // TODO: add tests for this for all clients tracer.letId(originalId, function () { callback.apply(_this, args); }); }; }
tracer.recordBinary('kafka.partition', partition); if (typeof remoteServiceName !== 'undefined') { tracer.recordAnnotation(new Annotation.ServerAddr({serviceName: remoteServiceName}));
function mkZipkinCallback(callback, id) { const originalId = tracer.id; return function zipkinCallback(...args) { tracer.letId(id, () => { const error = args[0]; if (error) { tracer.recordBinary('error', error.message || String(error)); } // TODO: parse host and port from details in callback // https://github.com/3rd-Eden/memcached#details-object tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: remoteServiceName })); tracer.recordAnnotation(new Annotation.ClientRecv()); }); // callback runs after the client request, so let's restore the former ID // TODO: add tests for this for all clients tracer.letId(originalId, () => { callback.apply(this, args); }); }; }
tracer.letId(id, () => { tracer.recordAnnotation(new Annotation.ClientSend()); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: remoteServiceName, host: new InetAddress(this.host), port: this.port.toString() })); tracer.recordRpc(`query ${this.database}`); });
const recordProducerStart = (tracer, name, remoteServiceName, {topic}) => { tracer.setId(tracer.createChildId()); const traceId = tracer.id; tracer.recordServiceName(tracer.localEndpoint.serviceName); tracer.recordRpc(name); tracer.recordBinary('kafka.topic', topic); if (typeof remoteServiceName !== 'undefined') { tracer.recordAnnotation(new Annotation.ServerAddr({serviceName: remoteServiceName})); } tracer.recordAnnotation(new Annotation.ProducerStart()); return traceId; }
function commonAnnotations(rpc) { tracer.recordRpc(rpc); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordAnnotation(new Annotation.ServerAddr(sa)); tracer.recordAnnotation(new Annotation.ClientSend()); }
_recordRequest(proxyReq) { this.tracer.recordServiceName(this.serviceName); this.tracer.recordRpc(proxyReq.method.toUpperCase()); this.tracer.recordBinary('http.path', getPathnameFromPath(proxyReq.path)); this.tracer.recordAnnotation(new Annotation.ClientSend()); if (this.remoteServiceName) { this.tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: this.remoteServiceName, port: parseInt(proxyReq.port) })); } }
/** * Records start of RPC request * @param {grpc.Metadata} metadata * @param {string} method * @return {zipkin.TraceId} */ start(metadata, method) { const traceId = this.tracer.createChildId(); this.tracer.letId(traceId, () => { this.tracer.recordServiceName(this.serviceName); this.tracer.recordRpc(method); this.tracer.recordAnnotation(new Annotation.ClientSend()); if (this.remoteServiceName) { this.tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: this.remoteServiceName })); } }); return traceId; }
function mkZipkinCallback(callback, id) { const originalId = tracer.id; return function zipkinCallback(...args) { tracer.letId(id, () => { const error = args[0]; if (error) { tracer.recordBinary('error', error.message || String(error)); } // TODO: parse host and port from details in callback // https://github.com/3rd-Eden/memcached#details-object tracer.recordAnnotation(new Annotation.ServerAddr({ serviceName: remoteServiceName })); tracer.recordAnnotation(new Annotation.ClientRecv()); }); // callback runs after the client request, so let's restore the former ID // TODO: add tests for this for all clients tracer.letId(originalId, () => { callback.apply(this, args); }); }; }
tracer.recordBinary('kafka.partition', partition); if (typeof remoteServiceName !== 'undefined') { tracer.recordAnnotation(new Annotation.ServerAddr({serviceName: remoteServiceName}));