{"bugs":{"url":"https://github.com/openzipkin/zipkin-js/issues"},"dist":{"shasum":"71c7968fad51b01b5930fa4129caa261df29a2e6","tarball":"https://registry.npmjs.org/zipkin/-/zipkin-0.22.1-alpha.6.tgz","fileCount":75,"integrity":"sha512-n8WXuNhRqnKT9QwViKvgeo5256F/tjV2LEZ9jUalaiWwfkTBq6FR6kfABN6TIZoJz35lzR/c7bMbx1wdV8QAMA==","signatures":[{"sig":"MEUCIAh2xehmqv1pQNWWqfFBoCZeDs089DTZiackVA7a6qqkAiEAowlRXLe7D8zM+ek8EqKLBTKqVprPH7T6xwFpfOGG6BA=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520750,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPMnTCRA9TVsSAnZWagAA4j0P/0XIlRV5N/D3esTUXLk2\nAlboOsbW5HWs3VfOmvLXf+ZwgBjgHa5mNzOSnskCsubivpSwBO+QKjio0gIm\nsxgz2/PAiBjkTXlywiTyCtcAOzq1g9p7TEW0M0GfolVC/FbsnwVvvIPuB+TN\ng2E56HYnQ1qFwPtxbC/wgCtTWviQc+TGLlnZNSVtEB7lZbXeixsowbiH8TUz\nwj7sQStX43H0eTUTAwkzJq8RMDr/Ro+n9WHJr0MycGcX5zeF9/K9rQtmVvOu\n9IQqUcIU9oL6ECw7QGVmdPTLUA/UGYfQKwVK4qJcnbRrFGfTCx/omISoCJJA\n25o5TdAsJG9XHQ6aQVJ/y6tf080BMucuLkOLrLCT0e8iTp0JPpZjtxdQDxkE\nB1PYF4B2bj6gaZY9gA+FAOnmHYkmVLJcunioHa796Mop86L7JWWcxlA0CP3d\ngo+N3MfxcnDMOJ4m1F5agD1QV7Ts5yG8NZEQDn+W2ptlnba7fGs4rAe1WS49\nRVOCNeSQZ/nIz53/AhYNTWC2bAsiZ/EUPvcRK/qAb/X5CH0Fzt5g9kupUZXe\nNO1/opyNZsAdzzmm1TiWIKbSQmcQE8lFjjXc3iJTBB3oU9SKLtpLi79b9EKa\nctmZ1sWqQXJk/hhu5XLN1BTLjj7OZGdhRU5UiaoOMe9EVeOq7CQVSqK1l3Di\nY1kh\r\n=ycxS\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"zipkin","types":"index.d.ts","unpkg":"dist/zipkin.js","author":{"name":"OpenZipkin","email":"openzipkin.alt@gmail.com"},"module":"es/index.js","readme":"# zipkin\n\nThis is the core npm package for Zipkin. It contains the public API which is used by the various\nplugins (instrumentations and transports).\n\nWe include TypeScript [definition file](index.d.ts) which you can also use as documentation.\n\n## Developing\n\nPlease always make sure that [TypeScript type definitions](index.d.ts) match source code modifications.\n\n## Usage\n\n```javascript\nconst zipkin = require('zipkin');\n\n// In Node.js, the recommended context API to use is zipkin-context-cls.\nconst CLSContext = require('zipkin-context-cls');\nconst ctxImpl = new CLSContext(); // if you want to use CLS\nconst xtxImpl = new zipkin.ExplicitContext(); // Alternative; if you want to pass around the context manually\n\n// Tracer will be a one to many relationship with instrumentation that use it (like express)\nconst tracer = new zipkin.Tracer({\n  ctxImpl, // the in-process context\n  recorder: new zipkin.ConsoleRecorder(), // For easy debugging. You probably want to use an actual implementation, like Kafka or AWS SQS.\n  sampler: new zipkin.sampler.CountingSampler(0.01), // sample rate 0.01 will sample 1 % of all incoming requests\n  traceId128Bit: true, // to generate 128-bit trace IDs. 64-bit (false) is default\n  localServiceName: 'my-service' // indicates this node in your service graph\n});\n```\n\n### In-process context (node only)\n\nThe event loop is what allows Node.js to perform non-blocking I/O operations, hence\nseveral operations are happening at the same time and we need a way to correlate different operations that happen at the same time to a specific trace. There are two options for this: explicit and implicit context.\n\nIn the **explicit context**, we pass around an object `ctx` from the top layer of the application down to those operations we want to trace. For example, a `ctx` will be handed from the HTTP handler down to the application layer and finally to a HTTP call that queries external resources.\n\nIn the **implicit context**, we don't need to pass anything, the in-process context is transparent for the user (see [zipkin-context-cls](pakcages/zipkin-context-cls)).\n\n### Local tracing\n\nSometimes you have activity that precedes a remote request that you want to\ncapture in a trace. `tracer.local` can time an operation, placing a\ncorresponding span ID in scope so that any downstream commands end up in the\nsame trace.\n\nHere's an example tracing a synchronous function:\n\n```javascript\n// A span representing checkout completes before result is returned\nconst result = tracer.local('checkout', () => {\n  return someComputation();\n});\n```\n\nHere's an example tracing a function that returns a promise:\n\n```javascript\n// A span is in progress and completes when the promise is resolved.\nconst result = tracer.local('checkout', () => {\n  return createAPromise();\n});\n```\n","gitHead":"ec89188cf6a07e184ab886c1dfb6c9dc276ddfa4","license":"Apache-2.0","scripts":{"test":"tsc --lib es6 index.d.ts && mocha --require ../../test/helper.js --require @babel/register && karma start --single-run --browsers ChromeHeadless,FirefoxHeadless ../../karma.conf.js","build":"rollup -c","prepublish":"npm run build","test-debug":"mocha --inspect-brk --require ../../test/helper.js","test-browser":"tsc index.d.ts && karma start --single-run --browsers ChromeHeadless ../../karma.conf.js"},"_npmUser":{"name":"openzipkin","email":"openzipkin-admin@googlegroups.com"},"homepage":"https://github.com/openzipkin/zipkin-js#readme","repository":{"url":"git+https://github.com/openzipkin/zipkin-js.git","type":"git"},"_npmVersion":"lerna/3.21.0/node@v12.21.0+x64 (linux)","description":"The core tracer for Zipkin JS","directories":{},"maintainers":[{"name":"openzipkin","email":"openzipkin-admin@googlegroups.com"}],"_nodeVersion":"12.21.0","dependencies":{"base64-js":"^1.1.2","is-promise":"^2.1.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","_npmOperationalInternal":{"tmp":"tmp/zipkin_0.22.1-alpha.6_1614596562567_0.9842284258802898","host":"s3://npm-registry-packages"},"_id":"zipkin@0.22.1-alpha.6","version":"0.22.1-alpha.6"}