{"name":"@opentelemetry/sdk-node","version":"0.10.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":{"test":"nyc ts-mocha -p tsconfig.json test/**/*.test.ts","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","build":"npm run compile","lint":"eslint . --ext .ts","lint:fix":"eslint . --ext .ts --fix","precompile":"tsc --version","version:update":"node ../../scripts/version-update.js","compile":"npm run version:update && tsc -p .","prepare":"npm run compile","watch":"tsc -w"},"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.10.0","@opentelemetry/context-base":"0.10.0","@opentelemetry/core":"0.10.0","@opentelemetry/metrics":"0.10.0","@opentelemetry/node":"0.10.0","@opentelemetry/resources":"0.10.0","@opentelemetry/tracing":"0.10.0"},"devDependencies":{"@opentelemetry/context-async-hooks":"0.10.0","@types/mocha":"7.0.2","@types/node":"14.0.13","codecov":"3.7.0","gts":"2.0.2","istanbul-instrumenter-loader":"3.0.1","mocha":"7.2.0","nyc":"15.1.0","ts-loader":"7.0.5","ts-mocha":"7.0.0","typescript":"3.9.5"},"gitHead":"ab62a4d69b99b3a8c9c26100c04f3226af7859df","bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","_id":"@opentelemetry/sdk-node@0.10.0","_nodeVersion":"12.14.1","_npmVersion":"lerna/3.22.1/node@v12.14.1+x64 (darwin)","dist":{"integrity":"sha512-7H+OWKoeqLcTe2sRJ5mLXyEh2ZjIVEIQAD9NyavjLZdrs/F6y6sK+7fx7BdVfaQM0c2GuHFHVChDJBTGoTPo8A==","shasum":"cdc8a267958690dea6ed5fb1543acbde4f91b0b2","tarball":"http://registry-npm.ywwl.com/@opentelemetry/sdk-node/download/@opentelemetry/sdk-node-0.10.0.tgz","fileCount":15,"unpackedSize":33740,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfH0BFCRA9TVsSAnZWagAA+nYP/01mTDt5i69aWePxw/ml\nWqA5ZsBr355DY8c9Pi8byNapIuYNIUtyghWvCPrDrgv2TcJ0yAKxYCkMOuDd\nFaHa/EiNpfEMv0Lcsd3CIoo3vLNuQvWn8dHO3TwcMEBrZnXKx/R38e9mviG+\n3eV8hzxNUI4+WRb3BD2bNxd2bddOcqVnUbpMOvQ6Pc+ndFSg+JorGzSbm7Ak\nsY2dV6D/pXk40ZqLlMCD5DnpprlYg7s/xszjjCl1TC43J6s6XPpgcsOwyUVx\nqDYi27kgvf4HKkRh6TeSE5E0eeY3rWsw+I+5kdU43z9wA7J4jAH9T2p8Uxse\nr3LVVqTSokvkbdz9p+wYwojVCBdu1hLeONXKxFHOdGlcsJMD8EXL0m1V8u9Z\nx1S9rZ3ga6hj9YVzHBE8nflmm6j0QP4mxHqvR2ROB6Q13h+eMihZFDZomcQW\nKXl2voO+wHEi7RdKDkpHWHrmQ7agR3B48QVlclhJogkA/gxphwW1K/1GEQtd\nfE/USyjR+hTH+JerVwGeFaUm18aNpCGEeWtU/bBDrP1PEigVHpI87NCzcztl\ncH3lzMTuLDvNwEioKlvnrgNtX5FDMpLWGV9acE7qfeGs3IflVNYvqbIZ6S1j\nVrmfEn4oejhe9/CGOOxAXnNj+s3TdB+v3vC4AwtVRgi7nKUcvL/hBcBMElqK\n2urO\r\n=WoHN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9ownoAiIJjfDrWo269QDp7P2NFgfY7p2MjoGX/LI4lAIgCppoZTlcxIYe6GJsLMTS8BIvTw4/Es6ngYKD5/he9Mg="}],"size":9955,"noattachment":false,"key":"/@opentelemetry/sdk-node/-/@opentelemetry/sdk-node-0.10.0.tgz"},"maintainers":[{"name":"obecny","email":"bobecny@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"mayurkale22","email":"mayurkale22@gmail.com"}],"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-node_0.10.0_1595883588887_0.4157209967034301"},"_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":1595883589071,"_cnpm_publish_time":1595883589071,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0","next":"0.34.0"}}