{"name":"@opentelemetry/sdk-node","version":"0.22.1-alpha.16","description":"OpenTelemetry SDK for Node.js","main":"build/src/index.js","types":"build/src/index.d.ts","repository":{"type":"git","url":"git+https://github.com/open-telemetry/opentelemetry-js.git"},"scripts":{"compile":"tsc --build","clean":"tsc --build --clean","test":"nyc ts-mocha -p tsconfig.json test/**/*.test.ts","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","version":"node ../../scripts/version-update.js","watch":"tsc --build --watch"},"keywords":["opentelemetry","nodejs","tracing","profiling","metrics","stats","monitoring"],"author":{"name":"OpenTelemetry Authors"},"license":"Apache-2.0","engines":{"node":">=8.0.0"},"publishConfig":{"access":"public"},"dependencies":{"@opentelemetry/api-metrics":"^0.22.0","@opentelemetry/core":"^0.22.1-alpha.16+5af147b1","@opentelemetry/instrumentation":"^0.22.1-alpha.16+5af147b1","@opentelemetry/metrics":"^0.22.1-alpha.16+5af147b1","@opentelemetry/node":"^0.22.1-alpha.16+5af147b1","@opentelemetry/resource-detector-aws":"^0.22.1-alpha.16+5af147b1","@opentelemetry/resource-detector-gcp":"^0.22.1-alpha.16+5af147b1","@opentelemetry/resources":"^0.22.1-alpha.16+5af147b1","@opentelemetry/tracing":"^0.22.1-alpha.16+5af147b1"},"peerDependencies":{"@opentelemetry/api":"^1.0.1"},"devDependencies":{"@opentelemetry/api":"^1.0.1","@opentelemetry/context-async-hooks":"^0.22.1-alpha.16+5af147b1","@types/mocha":"8.2.2","@types/node":"14.17.4","@types/semver":"7.3.6","@types/sinon":"10.0.2","codecov":"3.8.2","gcp-metadata":"^4.1.4","istanbul-instrumenter-loader":"3.0.1","mocha":"7.2.0","nock":"12.0.3","nyc":"15.1.0","semver":"7.3.5","sinon":"10.0.0","ts-loader":"8.3.0","ts-mocha":"8.0.0","typescript":"4.3.4"},"gitHead":"5af147b159c9dfad8d00a20a3b140d55736f1919","readme":"# OpenTelemetry SDK for Node.js\n\n[![NPM Published Version][npm-img]][npm-url]\n[![dependencies][dependencies-image]][dependencies-url]\n[![devDependencies][devdependencies-image]][devdependencies-url]\n[![Apache License][license-image]][license-image]\n\nThis package provides the full OpenTelemetry SDK for Node.js including tracing and metrics.\n\n## Quick Start\n\nTo get started you need to install `@opentelemetry/sdk-node`, a metrics and/or tracing exporter, and any appropriate instrumentation for the node modules used by your application.\n\n### Installation\n\n```sh\n$ # Install the SDK\n$ npm install @opentelemetry/sdk-node\n\n$ # Install exporters and plugins\n$ npm install \\\n    @opentelemetry/exporter-jaeger \\ # add tracing exporters as needed\n    @opentelemetry/exporter-prometheus # add metrics exporters as needed\n    @opentelemetry/instrumentation-http # add instrumentations as needed\n\n$ # or install all officially supported core and contrib plugins\n$ npm install @opentelemetry/auto-instrumentations-node\n\n```\n\n> Note: this example is for Node.js. See [examples/tracer-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/tracer-web) for a browser example.\n\n### Initialize the SDK\n\nBefore any other module in your application is loaded, you must initialize the SDK.\nIf you fail to initialize the SDK or initialize it too late, no-op implementations will be provided to any library which acquires a tracer or meter from the API.\n\nThis example uses Jaeger and Prometheus, but exporters exist for [other tracing backends][other-tracing-backends].\n\n```javascript\nconst opentelemetry = require(\"@opentelemetry/sdk-node\");\nconst { JaegerExporter } = require(\"@opentelemetry/exporter-jaeger\");\nconst { PrometheusExporter } = require(\"@opentelemetry/exporter-prometheus\");\nconst {\n  getNodeAutoInstrumentations,\n} = require(\"@opentelemetry/auto-instrumentations-node\");\n\nconst jaegerExporter = new JaegerExporter();\nconst prometheusExporter = new PrometheusExporter({ startServer: true });\n\nconst sdk = new opentelemetry.NodeSDK({\n  // Optional - if omitted, the tracing SDK will not be initialized\n  traceExporter: jaegerExporter,\n  // Optional - If omitted, the metrics SDK will not be initialized\n  metricExporter: prometheusExporter,\n  // Optional - you can use the metapackage or load each instrumentation individually\n  instrumentations: [getNodeAutoInstrumentations()],\n  // See the Configuration section below for additional  configuration options\n});\n\n// You can optionally detect resources asynchronously from the environment.\n// Detected resources are merged with the resources provided in the SDK configuration.\nsdk.start().then(() => {\n  // Resources have been detected and SDK is started\n});\n\n// You can also use the shutdown method to gracefully shut down the SDK before process shutdown\n// or on some operating system signal.\nconst process = require(\"process\");\nprocess.on(\"SIGTERM\", () => {\n  sdk\n    .shutdown()\n    .then(\n      () => console.log(\"SDK shut down successfully\"),\n      (err) => console.log(\"Error shutting down SDK\", err)\n    )\n    .finally(() => process.exit(0));\n});\n```\n\n## Configuration\n\nBelow is a full list of configuration options which may be passed into the `NodeSDK` constructor;\n\n### autoDetectResources\n\nDetect resources automatically from the environment using the default resource detectors. Default `true`.\n\n### contextManager\n\nUse a custom context manager. Default: [AsyncHooksContextManager](../opentelemetry-context-async-hooks/README.md)\n\n### textMapPropagator\n\nUse a custom propagator. Default: [CompositePropagator](../opentelemetry-core/src/context/propagation/composite.ts) using [W3C Trace Context](../opentelemetry-core/README.md#httptracecontext-propagator) and [Baggage](../opentelemetry-core/README.md#baggage-propagator)\n\n### metricProcessor\n\nUse a custom processor for metrics. Default: [UngroupedProcessor](../opentelemetry-metrics/src/export/Processor.ts#L50)\n\n### metricExporter\n\nConfigure a metric exporter. If an exporter is not configured, the metrics SDK will not be initialized and registered.\n\n### metricInterval\n\nConfigure an interval for metrics export in ms. Default: 60,000 (60 seconds)\n\n### instrumentations\n\nConfigure instrumentations. By default none of the instrumentation is enabled,\nif you want to enable them you can use either [metapackage](https://github.com/open-telemetry/opentelemetry-js-contrib/tree/main/metapackages/auto-instrumentations-node)\nor configure each instrumentation individually.\n\n### resource\n\nConfigure a resource. Resources may also be detected by using the `autoDetectResources` method of the SDK.\n\n### sampler\n\nConfigure a custom sampler. By default all traces will be sampled.\n\n### spanProcessor\n\n### traceExporter\n\nConfigure a trace exporter. If an exporter OR span processor is not configured, the tracing SDK will not be initialized and registered. If an exporter is configured, it will be used with a [BatchSpanProcessor](../opentelemetry-tracing/src/platform/node/export/BatchSpanProcessor.ts).\n\n### spanLimits\n\nConfigure tracing parameters. These are the same trace parameters used to [configure a tracer](../opentelemetry-tracing/src/types.ts#L71).\n\n## Useful links\n\n- For more information on OpenTelemetry, visit: <https://opentelemetry.io/>\n- For more about OpenTelemetry JavaScript: <https://github.com/open-telemetry/opentelemetry-js>\n- For help or feedback on this project, join us in [GitHub Discussions][discussions-url]\n\n## License\n\nApache 2.0 - See [LICENSE][license-url] for more information.\n\n[discussions-url]: https://github.com/open-telemetry/opentelemetry-js/discussions\n[license-url]: https://github.com/open-telemetry/opentelemetry-js/blob/main/LICENSE\n[license-image]: https://img.shields.io/badge/license-Apache_2.0-green.svg?style=flat\n[dependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-sdk-node\n[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-sdk-node\n[devdependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-sdk-node&type=dev\n[devdependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-sdk-node&type=dev\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/sdk-node\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fsdk-node.svg\n[other-tracing-backends]: https://github.com/open-telemetry/opentelemetry-js#trace-exporters\n","readmeFilename":"README.md","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","_id":"@opentelemetry/sdk-node@0.22.1-alpha.16","_nodeVersion":"14.17.1","_npmVersion":"lerna/3.22.1/node@v14.17.1+x64 (linux)","dist":{"integrity":"sha512-HEMJwgp731cC8/CMOrImVf6J039r1nycM02GFbr9nwCJvHY7k9VXNws+W413IEE8f2S95psC5gy1p1kRmYq43g==","shasum":"7bce35d9c876e8a54c1182fd793261fc55203915","tarball":"http://registry-npm.ywwl.com/@opentelemetry/sdk-node/download/@opentelemetry/sdk-node-0.22.1-alpha.16.tgz","fileCount":15,"unpackedSize":36213,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJg3Mq8CRA9TVsSAnZWagAAwIsP/jPdqnzpR3bk1q2abIM/\nGTCUgAVK+/c8a1Lfy7dZ+KQtrWhCBFK6ZsqaTbR2jWOwZEeBJoGPktDa3sxk\nIdgd1zu+OUsZPqeq2R4p/dLV0y5/ZzTuyChlhY+39D+/bOLkIavgA3ursvfp\npkSXwa4O3RrP5YfPWNeDjm1bEeoIy/BvPl9eOtn/6msAro4xiZKuSKOIxFQt\nIMttRTFmUud1IwFvT2GbHdynSDaVzDsuVagkpvlK5J4mqN1pWTW/iKdft9NS\npMikvCLOCHHtsMymoe4vFW/si/XVV9SxQ2T/y/YSWQ5iqPshtNNBlqSe/Evz\nGAoKNdZ1bGwC/a7G9MC+W2TxV6OB0uGn/UWTfpTiCskkNu7Hn3F8GbuH6C3n\nqv6Ob4s5lacbaJHyj5IDFP4MQf8Tt17Oeu6wl2Grk2QyqSLULgabTMjxO0+h\n6Nbh9p91UyPwm1iOrH0HFdGmCfKzyvtPcoCaNrnipy5LTZ+mYRq04hotaGX9\nwsIZ89dcX1A+IopHkSaWr+HuxLyG0fMHswl26e///XZucWUvwWwfL2bpm3pn\nxYxvovYaw2tIBbzY0HAkj/LDKl3LlvHmUN2vQhmxOM7pzlTy8vks+CbhSZbm\nKZnzNLVCg43Icrx660OU3i5qNZKrS4zBgl7JTKFAXAHdquI0u4xnf9hALFUT\nw3BP\r\n=tlGr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC1cymyOP4Xbw7roJe4QqDyNI2sWO7A13tdpy+9tp/vWAiEAynzPFTw5Xq2+YW49CgnlK+RwzpZU9VK3kFJz2+eMTko="}],"size":10529,"noattachment":false,"key":"/@opentelemetry/sdk-node/-/@opentelemetry/sdk-node-0.22.1-alpha.16.tgz"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"maintainers":[{"name":"mayurkale22","email":"mayurkale22@gmail.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"obecny","email":"bobecny@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-node_0.22.1-alpha.16_1625082556120_0.3671135663977185"},"_hasShrinkwrap":false,"publish_time":1625082556246,"_cnpm_publish_time":1625082556246,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0","next":"0.34.0"}}