{"name":"@opentelemetry/sdk-node","version":"0.18.0","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":"^0.18.0","@opentelemetry/api-metrics":"^0.18.0","@opentelemetry/core":"^0.18.0","@opentelemetry/instrumentation":"^0.18.0","@opentelemetry/metrics":"^0.18.0","@opentelemetry/node":"^0.18.0","@opentelemetry/resource-detector-aws":"^0.18.0","@opentelemetry/resource-detector-gcp":"^0.18.0","@opentelemetry/resources":"^0.18.0","@opentelemetry/tracing":"^0.18.0","nock":"12.0.3"},"devDependencies":{"@opentelemetry/context-async-hooks":"^0.18.0","@types/mocha":"8.2.0","@types/node":"14.14.20","@types/semver":"7.3.4","@types/sinon":"9.0.10","codecov":"3.8.1","gcp-metadata":"^4.1.4","gts":"3.1.0","istanbul-instrumenter-loader":"3.0.1","mocha":"7.2.0","nyc":"15.1.0","semver":"7.3.4","sinon":"9.2.3","ts-loader":"8.0.14","ts-mocha":"8.0.0","typescript":"4.1.3"},"gitHead":"6540b54a8bd49746e164ab730269188237f89b1c","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","_id":"@opentelemetry/sdk-node@0.18.0","_nodeVersion":"14.8.0","_npmVersion":"lerna/3.22.1/node@v14.8.0+x64 (darwin)","dist":{"integrity":"sha512-2XhqI24sG4nLKg+je1ZqjL3f5gHn1k4EtNG7JLHtn0K1kKLA1AEyMuAC0T/0yZzWTpZ+iO5omZU8x0Ateyd2iQ==","shasum":"8b5e22dd30b688dc8758a38e054d05045fa8c395","tarball":"http://registry-npm.ywwl.com/@opentelemetry/sdk-node/download/@opentelemetry/sdk-node-0.18.0.tgz","fileCount":15,"unpackedSize":36060,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgPkU0CRA9TVsSAnZWagAAcm0P/345TJF7pTlw0uVh4fxj\nmBGZFL1XUt/nBQ02xkkTwlN/uyxk0ALFXm+v0CvKCIDLer/ZktazSXF5uJfn\nmP0m/GUmn4RhcPOPNRMz1tiakY1FOACDFkPjLiPJjULajxzwbw69kZBy9pOL\nUzWnJJy9E+ACZ1AdNBU1BMX0mDrPwAm7jX5mY9JR7qoCuGEioTl6vGKWpbeH\n85ME4BSlDVv+ubeEGzTpPsldP+6ykDeo8+r71GYzN9pJ8oFD0988q61pgZdY\n9Acb1UeVhzFtY/Hqu/yLzODNpDEywNs19S9ML2qKzWHcGBjXJgJ10RfGzWX7\n9e4axHe69mMyxrdumMHd/UCcJ+zL/W9JBmFNzLCy/Xp+ao85qvy30qYNs1+a\nVotj0IR4whBJW3S2GhUldrnRB5mWSzp8bjsZPaNU4r15RgSyIj2mpf9vLHpK\nfrx8LRYadTGG35MF+SPMEPVtNUUuCqOxddaUAnGCcpNS/Uvz0ncX7SIghlM9\nAF/95V/kb2q0zcgNH6vYATql3DUB9df5iyXvyrTbCQW91EEGsNFCTNSBx9e8\n/hcDjEXPRqbsNLQpdJ/MrH4/qPLUrsHSnqHoXNW7W5pYyL6Pl+kLqQOcP1IF\nZJ6/mmn11SsT8LpeWHOePFReCLT7pz1GykZ58MnR/lx1Egw7rpXXqh9pvLkE\nUlwh\r\n=IqZt\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBMId52w240FCH/+MFXjpFvbBdbutfnCr3w4qDZOoqR3AiAO/A2JsxMWwduuyMPdaUOg/j7/hNBIlxwWiQ15b0Lxqg=="}],"size":10545,"noattachment":false,"key":"/@opentelemetry/sdk-node/-/@opentelemetry/sdk-node-0.18.0.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.18.0_1614693684542_0.7949355729732572"},"_hasShrinkwrap":false,"readme":"# OpenTelemetry SDK for Node.js\n\n[![NPM Published Version][npm-img]][npm-url]\n[![Apache License][license-image]][license-image]\n\n**Note: This is an experimental package under active development. New releases may include breaking changes.**\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/opentelemetry-web](https://github.com/open-telemetry/opentelemetry-js/tree/main/examples/opentelemetry-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].\nAs shown in the installation instructions, exporters passed to the SDK must be installed alongside `@opentelemetry/sdk-node`.\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();\n\nconst sdk = new opentelemetry.NodeSDK({\n  // Optional - if omitted, the tracing SDK will be initialized from environment variables\n  traceExporter: jaegerExporter,\n  // Optional - If omitted, the metrics SDK will not be initialized\n  metricReader: 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\nsdk.start();\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](../../../packages/opentelemetry-context-async-hooks/README.md)\n\n### textMapPropagator\n\nUse a custom propagator. Default: [CompositePropagator](../../../packages/opentelemetry-core/src/propagation/composite.ts) using [W3C Trace Context](../../../packages/opentelemetry-core/README.md#w3ctracecontextpropagator-propagator) and [Baggage](../../../packages/opentelemetry-core/README.md#baggage-propagator)\n\n### metricReader\n\nAdd a [MetricReader](../opentelemetry-sdk-metrics/src/export/MetricReader.ts)\nthat will be passed to the `MeterProvider`. If `metricReader` is not configured,\nthe metrics SDK will not be initialized and registered.\n\n### views\n\nA list of views to be passed to the `MeterProvider`.\nAccepts an array of [View](../opentelemetry-sdk-metrics/src/view/View.ts)-instances.\nThis parameter can be used to configure explicit bucket sizes of histogram metrics.\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### resourceDetectors\n\nConfigure resource detectors. By default, the resource detectors are [envDetector, processDetector, hostDetector].\nNOTE: In order to enable the detection, the parameter `autoDetectResources` has to be `true`.\n\nIf `resourceDetectors` was not set, you can also use the environment variable `OTEL_NODE_RESOURCE_DETECTORS` to enable only certain detectors, or completely disable them:\n\n- `env`\n- `host`\n- `os`\n- `process`\n- `serviceinstance` (experimental)\n- `all` - enable all resource detectors above\n  - **NOTE:** future versions of `@opentelemetry/sdk-node` may include additional detectors that will be covered by this scope.\n- `none` - disable resource detection\n\nFor example, to enable only the `env`, `host` detectors:\n\n```shell\nexport OTEL_NODE_RESOURCE_DETECTORS=\"env,host\"\n```\n\n### sampler\n\nConfigure a custom sampler. By default, all traces will be sampled.\n\n### spanProcessor\n\nDeprecated, please use [spanProcessors](#spanprocessors) instead.\n\n### spanProcessors\n\nAn array of span processors to register to the tracer provider.\n\n### traceExporter\n\nConfigure a trace exporter. If an exporter is configured, it will be used with a [BatchSpanProcessor](../../../packages/opentelemetry-sdk-trace-base/src/platform/node/export/BatchSpanProcessor.ts). If an exporter OR span processor is not configured programmatically, this package will auto setup the default `otlp` exporter  with `http/protobuf` protocol with a `BatchSpanProcessor`.\n\n### spanLimits\n\nConfigure tracing parameters. These are the same trace parameters used to [configure a tracer](../../../packages/opentelemetry-sdk-trace-base/src/types.ts#L71).\n\n### serviceName\n\nConfigure the [service name](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/semantic_conventions/README.md#service).\n\n## Disable the SDK from the environment\n\nDisable the SDK by setting the `OTEL_SDK_DISABLED` environment variable to `true`.\n\n## Configure log level from the environment\n\nSet the log level by setting the `OTEL_LOG_LEVEL` environment variable to enums:\n\n- `NONE`,\n- `ERROR`,\n- `WARN`,\n- `INFO`,\n- `DEBUG`,\n- `VERBOSE`,\n- `ALL`.\n\nThe default level is `INFO`.\n\n## Configure Trace Exporter from environment\n\nThis is an alternative to programmatically configuring an exporter or span processor. This package will auto setup the default `otlp` exporter with `http/protobuf` protocol if `traceExporter` or `spanProcessor` hasn't been passed into the `NodeSDK` constructor.\n\n### Exporters\n\n| Environment variable | Description |\n|----------------------|-------------|\n| OTEL_TRACES_EXPORTER | List of exporters to be used for tracing, separated by commas. Options include `otlp`, `jaeger`, `zipkin`, and `none`. Default is `otlp`. `none` means no autoconfigured exporter. |\n\n### OTLP Exporter\n\n| Environment variable | Description |\n|----------------------|-------------|\n| OTEL_EXPORTER_OTLP_PROTOCOL | The transport protocol to use on OTLP trace, metric, and log requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |\n| OTEL_EXPORTER_OTLP_TRACES_PROTOCOL | The transport protocol to use on OTLP trace requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |\n| OTEL_EXPORTER_OTLP_METRICS_PROTOCOL | The transport protocol to use on OTLP metric requests. Options include `grpc`, `http/protobuf`, and `http/json`. Default is `http/protobuf`. |\n\nAdditionally, you can specify other applicable environment variables that apply to each exporter such as the following:\n\n- [OTLP exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/exporter.md#configuration-options)\n- [Zipkin exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/6ce62202e5407518e19c56c445c13682ef51a51d/specification/sdk-environment-variables.md#zipkin-exporter)\n- [Jaeger exporter environment configuration](https://github.com/open-telemetry/opentelemetry-specification/blob/6ce62202e5407518e19c56c445c13682ef51a51d/specification/sdk-environment-variables.md#jaeger-exporter)\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[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","publish_time":1614693684712,"_cnpm_publish_time":1614693684712,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0","next":"0.34.0"}}