{"name":"@opentelemetry/sdk-node","version":"0.10.1","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.1","@opentelemetry/context-base":"^0.10.1","@opentelemetry/core":"^0.10.1","@opentelemetry/metrics":"^0.10.1","@opentelemetry/node":"^0.10.1","@opentelemetry/resources":"^0.10.1","@opentelemetry/tracing":"^0.10.1"},"devDependencies":{"@opentelemetry/context-async-hooks":"^0.10.1","@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":"03981e4299282d0611d1255ab0076368d5830753","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.1","_nodeVersion":"12.14.1","_npmVersion":"lerna/3.22.1/node@v12.14.1+x64 (darwin)","dist":{"integrity":"sha512-yG6sdzNASHqXXNT8mi0StWKDu3bAlTSmxJyriFL4riCgM7YL4kZB6/v836el6V4mlINI+Gh5BbFsBxSoYnfpfg==","shasum":"b90cdfa0c0a32a705d3da4da4a17f581f5ec3516","tarball":"http://registry-npm.ywwl.com/@opentelemetry/sdk-node/download/@opentelemetry/sdk-node-0.10.1.tgz","fileCount":15,"unpackedSize":33748,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfIECBCRA9TVsSAnZWagAAQYEP/Raej3NOrNuswEj8/7+6\nvLHPbWk8ztHlf1ebQoluUfWMB5i9XoBeupQKuVyelJ+cfPAl2z7gMQ8SLgUb\nqswIL4ZJEmCGCHyAzDHE/wx91qMS5cU4V4FYgnLrIgOgJCd3ohDeyikeIMjs\niAqD9I961ELIvBYfULGz1u1v1PLXYxW7FBQrH8d7cae9we6BLWJF6BwYTqM+\neNnElQP5S5/trsHxNQSBuCKZNl8B1Vb0KsFs2xv/pUgTtBnllOEuc0YRRBOb\n00/2Bd5hleWSnvm8x3oSVGIQ74MmAMnVYPNUp+R4B072qiJZbw8MRW+B4y7o\nwXKFIua5DLPejzpyvNkL6i4PQBdqXQ+v2xPGc2EH2/SnVNpNERiSbKSM9zCL\nkh2RhjIe9V//J70ybiN2biNFkoswpNoTT/uA+XvcQ8JKNTcTjhzmzBJ3vaae\nIUG6/CcS29z3bfCsHxCictcq7Qiiw3RYAO5eu/j3RxHNSAljOgS9PAG44Ccf\n4FzafG/MxfpYnRx+pl4ITVdRrR8+r75tMJoKGUDTze8hRo6i84U9/ajbZxgV\nFlO5BC7D+vjUTIlc1WF/UuTgdgmOgfARBz6tji4ubkmYdqPKj9nkYMwZHB53\nOJm7DVrChPwCq3oWYYPi8Z8X0WOd8/weCPPoGnb6h4FVmN9MJXJMzjsD+M9b\nTpcT\r\n=3rn+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDrjn0/F5EfNtxsqqJaA/rsobxBP+zwZs6t8erkUiP6HQIhAM5P6O2zfRbblSph5osVP9cTxfvu9ZooQpdtDvzDK+GY"}],"size":9957,"noattachment":false,"key":"/@opentelemetry/sdk-node/-/@opentelemetry/sdk-node-0.10.1.tgz"},"maintainers":[{"name":"bogdandrutu","email":"bogdandrutu@gmail.com"},{"name":"dyladan","email":"dyladan@gmail.com"},{"name":"mayurkale22","email":"mayurkale22@gmail.com"},{"name":"obecny","email":"bobecny@gmail.com"}],"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sdk-node_0.10.1_1595949184439_0.36014091290704386"},"_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":1595949184886,"_cnpm_publish_time":1595949184886,"dist-tags":{"canary":"0.300.0-rc.0","latest":"0.301.0","next":"0.34.0"}}