function commonAnnotations(rpc) { tracer.recordAnnotation(new Annotation.ClientSend()); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordRpc(rpc); }
recordResponse(rsp, clientTraceId) { this.tracer.letId(clientTraceId, () => { this.tracer.recordBinary('http.status_code', rsp.statusCode.toString()); this.tracer.recordAnnotation(new Annotation.ClientRecv()); }); }
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; }
server.ext('onRequest', (request, h) => { const {headers} = request; const readHeader = headerOption.bind(null, headers); const traceId = tracer.scoped( () => instrumentation.recordRequest(request.method, url.format(request.url), readHeader) ); Object.defineProperty(request, '_trace_id', {configurable: false, get: () => traceId}); return h.continue; });
describe('InetAddress', () => { it('should have correct type', () => { const addr: InetAddress = new InetAddress('80.91.37.133'); expect(addr.ipv4).to.be.a('function'); }); });
_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 recordProducerStop = (tracer, id, error) => { tracer.letId(id, () => { if (error) { tracer.recordBinary('error', error.toString()); } tracer.recordAnnotation(new Annotation.ProducerStop()); }); }
describe('JsonEncoder', () => { it('should have correct type', () => { const v1: JsonEncoder = jsonEncoder.JSON_V1; const v2: JsonEncoder = jsonEncoder.JSON_V2; const span: model.Span = new model.Span(new TraceId({ spanId: 'xyz' })); expect(v1.encode(span)).to.be.a('string'); expect(v2.encode(span)).to.be.a('string'); }); });
function annotateSuccess(id) { tracer.letId(id, () => { tracer.recordAnnotation(new Annotation.ClientRecv()); }); }
describe('ExplicitContext', () => { it('should return correct type', () => { const explicitContext: ExplicitContext = new ExplicitContext(); expect(explicitContext.scoped).to.be.a('function'); }); });
const recordConsumeStop = (tracer, id, error) => { tracer.letId(id, () => { if (typeof error !== 'undefined') { tracer.recordBinary('error', error.toString()); } tracer.recordAnnotation(new Annotation.ConsumerStop()); }); }
function commonAnnotations(rpc) { tracer.recordAnnotation(new Annotation.ClientSend()); tracer.recordAnnotation(new Annotation.ServiceName(serviceName)); tracer.recordRpc(rpc); }
const recordProducerStop = (tracer, id, error) => { tracer.letId(id, () => { if (error) { tracer.recordBinary('error', error.toString()); } tracer.recordAnnotation(new Annotation.ProducerStop()); }); }
function annotateSuccess(id) { tracer.letId(id, () => { tracer.recordAnnotation(new Annotation.ClientRecv()); }); }
describe('InetAddress', () => { it('should have correct type', () => { const addr: InetAddress = new InetAddress('80.91.37.133'); expect(addr.ipv4).to.be.a('function'); }); });