{"bugs":{"url":"https://github.com/openzipkin/zipkin-js/issues"},"dist":{"shasum":"f7f781e9d39c3f011eecd3d6aa334e7dda45e029","tarball":"https://registry.npmjs.org/zipkin-transport-http/-/zipkin-transport-http-0.19.3-alpha.2.tgz","fileCount":13,"integrity":"sha512-ZiZ3PfC22yKWnptFRTtZ8xYHdzp1wkHwRbPeZ9XN5+sGImsW8g2rLXLjFyaRu2zI92QxTsvZ/zR2hs7fQl9L+g==","signatures":[{"sig":"MEQCIE5U5W6u2z0+BJfjC9zxwKfkQmvAqezIMcdToVZV2d7uAiA5eA90lM2jQSK9pNvTZGTqq0LWZZb4nUQsj/cHjBlzSg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":43234,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeU9N/CRA9TVsSAnZWagAA1hsQAIjR6sbx9OeP2kxS7MGE\nMQZiOlSWjr+KxqyE6ooT/dgF6XNEy6c1W8HITB/C94TYFtH2BHezrh++d+B5\n+WkBW/ddoWvrImZJlB26mKpO8BTKApb+BApAay1y0LJrv+kVjhaVvykkepsh\nSN4lF4BrJCiPe9GGj4Yw4HuiczXuMCuH4P+aUIDexRPtF44FL+BP5OgzIO1E\nsifkUZKHunCiZ6iDKLd7HFgjsuOfjSw2N+GTmkcpATqlmx+wZmdxduqQ2wds\nqXyT5ofz8orTMDwg2IAILaNYEVewQ0c4+3cqgePavxrjQjNBfrwnjWtWmKZh\n4fBpo4wDbGW59C4ZTnth+q8zJCh9RETn8rTmyf6vDbrcDIR5rw/1M168eENx\nlooIlvqp7Jv2ywDrKWLNMO4W3M5QvaME8yjnazko1RpgkeuSQEy1NowNdnK7\nstkiRc1faJobmTrMt1Rx33v/Q+GEpUly8nbnHQjMUm67xgc5GbYMxNLkceby\nioQd5SpQfv/+JuxC+dhRgF7J3w/PzoMlNur+QrPGmJAwA0XxH0cWdoLG5Rni\nG38j3as6IIJWzNNKTt8C7loXhAPITEbTZLL7IOzN59vvgUccYKKSFDjR96HW\niMNtiu6VHT9f/sgmYenIR0gSySA0j6S/GHTzhugfZIqod2D2lqQd64vcshtG\n0YJ/\r\n=2RHP\r\n-----END PGP SIGNATURE-----\r\n"},"main":"lib/index.js","name":"zipkin-transport-http","types":"index.d.ts","author":{"name":"Openzipkin","email":"openzipkin.alt@gmail.com"},"readme":"\n# zipkin-transport-http\n\n![npm](https://img.shields.io/npm/dm/zipkin-transport-http.svg)\n\nThis is a module that sends Zipkin trace data to a configurable HTTP endpoint.\n\n## Usage\n\n`npm install zipkin-transport-http --save`\n\n```javascript\nconst {\n  Tracer,\n  BatchRecorder,\n  jsonEncoder: {JSON_V2}\n} = require('zipkin');\nconst {HttpLogger} = require('zipkin-transport-http');\nconst noop = require('noop-logger');\n\nconst recorder = new BatchRecorder({\n  logger: new HttpLogger({\n    endpoint: 'http://localhost:9411/api/v2/spans', // Required\n    jsonEncoder: JSON_V2, // JSON encoder to use. Optional (defaults to JSON_V1)\n    httpInterval: 1000, // How often to sync spans. Optional (defaults to 1000)\n    headers: {'Authorization': 'secret'}, // Custom HTTP headers. Optional\n    timeout: 1000, // Timeout for HTTP Post. Optional (defaults to 0)\n    maxPayloadSize: 0 // Max payload size for zipkin span. Optional (defaults to 0)\n    agent: new http.Agent({keepAlive: true}), // Agent used for network related options. Optional (defaults to null)\n    log: noop // Logger to use. Optional (defaults to console)\n    fetchImplementation: require('node-fetch') // Pluggable fetch implementation (defaults to global fetch or fallsback to node fetch)\n  })\n});\n\nconst tracer = new Tracer({\n  recorder,\n  ctxImpl, // this would typically be a CLSContext or ExplicitContext\n  localServiceName: 'service-a' // name of this application\n});\n```\n\n## Options\n\n### Required\n\n- **endpoint** - HTTP endpoint which spans will be sent.\n\n### Optional\n\n- **agent** - HTTP(S) agent to use for any networking related options.\n  - Takes an [http](https://nodejs.org/api/http.html#http_class_http_agent)/[https](https://nodejs.org/api/https.html) NodeJS Agent.\n  - Defaults to null\n\n```javascript\n// Example using a self-signed CA, along with cert/key for mTLS.\nnew HttpLogger({\n  endpoint: 'http://localhost:9411/api/v2/spans',\n  agent: new http.Agent({\n    ca: fs.readFileSync('pathToCaCert'),\n    cert: fs.readFileSync('pathToCert'),\n    key: fs.readFileSync('pathToPrivateKey')\n  })\n})\n```\n\n- **headers** - Any additional HTTP headers to be sent with span.\n  - Will set `'Content-Type':  'application/json'` at a minimum\n- **httpInterval** - How often to sync spans.\n  - Defaults to 1000\n- **jsonEncoder** - JSON encoder to use when sending spans.\n  - Defaults to JSON_V1\n- **maxPayloadSize** - Max payload size for zipkin span.\n  - Will drop any spans exceeding this threshold.\n  - Defaults to 0 (Disabled)\n- **log** - Internal logger used within the transport.\n  - Defaults to console\n- **timeout** - Timeout for HTTP Post when sending spans.\n  - Defaults to 0 (Disabled)\n- **fetchImplementation** - The fetch API to be used for sending spans.\n  - Defaults to default global fetch or fallsback to `node-fetch`.\n  - A different fetch implementation can be plugged to fulfill different requirements, for example one can use [fetch-retry](https://github.com/jonbern/fetch-retry) to allow retries and exponential back-off:\n\n    ```javascript\n    const {HttpLogger} = require('zipkin-transport-http');\n    const fetch = require('node-fetch');\n    const fetchRetryBuilder = require('fetch-retry');\n\n    const fetchRetryOptions = {\n      // retry on any network error, or > 408 or 5xx status codes\n      retryOn: (attempt, error, response) => error !== null\n        || response == null\n        || response.status >= 408,\n      retryDelay: tryIndex => 1000 ** tryIndex // with an exponentially growing backoff\n    };\n\n    const fetchImplementation = fetchRetryBuilder(fetch, fetchRetryOptions);\n\n    const httpLogger = new HttpLogger({\n      endpoint: `http://localhost:9411/api/v1/spans`,\n      httpInterval: 1,\n      fetchImplementation\n    });\n    ```\n","gitHead":"7ae7e1f39a055bccf3ec508bb239640835aedbef","license":"Apache-2.0","scripts":{"test":"mocha --exit --require ../../test/helper.js","build":"babel src -d lib","prepublish":"npm run build","test-debug":"mocha --inspect-brk --exit --require ../../test/helper.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.20.2/node@v12.16.1+x64 (linux)","description":"Transports Zipkin trace data via HTTP","directories":{},"maintainers":[{"name":"openzipkin","email":"openzipkin.alt@gmail.com"}],"_nodeVersion":"12.16.1","dependencies":{"zipkin":"^0.19.2"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"node-fetch":"^2.3.0","body-parser":"^1.15.2","fetch-retry":"3.1.0","noop-logger":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/zipkin-transport-http_0.19.3-alpha.2_1582551934989_0.6672359526365537","host":"s3://npm-registry-packages"},"_id":"zipkin-transport-http@0.19.3-alpha.2","version":"0.19.3-alpha.2"}