{"bugs":{"url":"https://github.com/openzipkin/zipkin-js/issues"},"dist":{"shasum":"0b10a9f04d362b485ad30c142c8bdeab6309dc58","tarball":"https://registry.npmjs.org/zipkin/-/zipkin-0.22.1-alpha.3.tgz","fileCount":75,"integrity":"sha512-yPG+mW9GlR4TqyDxHCgt9+7dFDxuJ8rq42h+JVOSJnvrqTXFGufILUcps9cK3+5vp4chayd/wrWwlP5g0Q66aA==","signatures":[{"sig":"MEUCIAn1gwQkdviQqnh7MUbCOXehKY6/60SyhjhfgjO7f1JfAiEAo7ZWpCaCVWLzhmqiuCQppl4dXM0kjcwE40fC/c3FNps=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":520748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfoKU3CRA9TVsSAnZWagAADgAP/3O2ZDqtldMhFBcQlMAJ\nwWi6sfeJaU3U1hHsg11RO0JPfKbkR3BgTJRUR8R8pXTiVPe+D8W4UCgTWpxB\n8UMlStLcLtb1xPaBtkw+J67voJ91bwTDsI4zrKN92x2GZBM2fA3Kc3uiowre\nJ06cy4z3oyuNpwlQbdy8fvcdZ+PTH8B7PXvJrIr+4y0alC8Y9m2RVV5XKW6A\n1oslIMcGQ0EXVEsnhce2Bm6ZTKVyYJSd9ScxG5dMNXszE51gxf1CwkqcOQ+F\nT/vvoq+3HtTo+SN49ji/Rn/aSKlbw1RsL8TZo8Vco0aXA/UPz/148iTVwMs2\nFinxbjhFeLXiKFbze6Xwz2t76639T+qe3S3PU4Nn16u1aQnZJ2JuOmoIeAY3\ntMg5pab0b89Rbya/mm6KUE7Gst+K29q+p/jDld3/gm8VHyHSb/RbFjsmDRky\nHV8ihcKTW+YZsXJFdgn+juxC+FpJ+uyU/2qPLYBvIV0F6w5tS9riJ7rZrfqe\n+BTaB1v2MReGkrTa6+wUyrigd2Svkd+jZk7W9XxgL4t4ItMIOKkktjudfMT4\n508S+Q5GVwge1pkSV+BCDkoAAMvj9pkJhu2FnJPqAqV5bufxXdnk2WoWypZT\nvlqajs7QH59bG2yV6f5iDeLyfs70LYhh9GLBVMUmThkxTQXtaz1daC8qIUUw\nB/oJ\r\n=x41P\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":"bf7de8783a280b3e0d01eacd90ed1d9b4f10c7c4","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.19.0+x64 (linux)","description":"The core tracer for Zipkin JS","directories":{},"maintainers":[{"name":"openzipkin","email":"openzipkin-admin@googlegroups.com"}],"_nodeVersion":"12.19.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.3_1604363574720_0.7814485711044477","host":"s3://npm-registry-packages"},"_id":"zipkin@0.22.1-alpha.3","version":"0.22.1-alpha.3"}