{"bugs":{"url":"https://github.com/open-telemetry/opentelemetry-js/issues"},"dist":{"shasum":"3b996842c8043068da4d11a6e96960e757ad6be9","tarball":"https://registry.npmjs.org/@opentelemetry/api-metrics/-/api-metrics-0.25.0.tgz","fileCount":111,"integrity":"sha512-9T0c9NQAEGRujUC7HzPa2/qZ5px/UvB2sfSU5CAKFRrAlDl2gn25B0oUbDqSRHW/IG1X2rnQ3z2bBQkJyJvE4g==","signatures":[{"sig":"MEQCICFJn8/21OWvz1oXGqoojyp9JPQBA/JQMRumYZfCVeL+AiAOWQcaISoIORe+rNnCmNKZh1Y+AuzapHqx0TFEQq45Bw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":126002,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhHXi0CRA9TVsSAnZWagAADxYQAIJM4YgrViIIbQUU8N14\nTSzGwdQmxDMcXEyBrOmx2AM2mRThPw5jGiqfp1/JHNoAFvzn04Fp18arhrTF\n7i0zA21pidoDhKggNIZ/fL77iFyHWNMkYgRALpH0TtQlzgX94hjaWcydriEx\novxeZbz3LrSK+y2KiBzsNuIuCxAQxApc/GY4KOl4LO+J0VN/A3OW4X2zd/Cp\naMpwFAfqHpUfL33j2byPxujBVb0RiP5uChkDadSUfZtQEx0YDELFXRfmRcHT\n9J8Ux2oVjoC12B88xqmirzuuIEYzHxKqha602NBiaW31Z+Vg/iAP/Z64tSUO\nca0T2xm49taHJ4KdOSzWnaeYBhxTUnO9Q5e6bN0Ly/i3WpX+xmhaZC/FAXf2\n2oRInBg0ykmOyLhuc4VVxsYk9aaM3keMjskzLoPssVmnbQ5RRHyWBe/DZnUf\nJ/sYKSOl5cwH+1T6Yagjix47KBDfsBQxJ8H++jBUQlPCig3LugGetagDdR+a\nLlub39Fs4Y7QOSgkiyThwIj33WiEDLpt6SkXws1y/xwqSt37Mhz6zEvDfyaO\ncBhQnlBd4UlAhBern7nsqN9Zk/xNKHTCNTxHTa0yBEv0hVDOO7RrFn+JxN3O\nb32UQLxzbqWFzju6vkpV7nV+bqBYN5GSFnP/COrKh3j368IzQTZObsex7pEN\ny7qP\r\n=rrMn\r\n-----END PGP SIGNATURE-----\r\n"},"main":"build/src/index.js","name":"@opentelemetry/api-metrics","types":"build/src/index.d.ts","author":{"name":"OpenTelemetry Authors"},"module":"build/esm/index.js","readme":"# OpenTelemetry API for JavaScript\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 everything needed to interact with the unstable OpenTelemetry Metrics API, including all TypeScript interfaces, enums, and no-op implementations. It is intended for use both on the server and in the browser.\n\n## Beta Software - Use at your own risk\n\nThe metrics API is considered alpha software and there is no guarantee of stability or long-term support. When the API is stabilized, it will be made available and supported long-term in the `@opentelemetry/api` package and this package will be deprecated.\n\n## Quick Start\n\nTo get started you need to install the SDK and instrumentations, create a MeterProvider, and register it with the API.\n\n### Install Dependencies\n\n```sh\n$ # Install metrics dependencies\n$ npm install \\\n    @opentelemetry/api-metrics \\\n    @opentelemetry/sdk-metrics-base \\\n    @opentelemetry/exporter-prometheus # add exporters as needed\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 global tracer and meter providers. If you fail to initialize a provider, no-op implementations will be provided to any library which acquires them from the API.\n\nTo collect traces and metrics, you will have to tell the SDK where to export telemetry data to. This example uses Jaeger and Prometheus, but exporters exist for [other tracing backends][other-tracing-backends]. If you're not sure if there is an exporter for your tracing backend, contact your tracing provider.\n\n#### Metrics\n\n```javascript\nconst api = require(\"@opentelemetry/api-metrics\");\nconst { MeterProvider } = require(\"@opentelemetry/sdk-metrics-base\");\nconst { PrometheusExporter } = require(\"@opentelemetry/exporter-prometheus\");\n\nconst meterProvider = new MeterProvider({\n  // The Prometheus exporter runs an HTTP server which\n  // the Prometheus backend scrapes to collect metrics.\n  exporter: new PrometheusExporter({ startServer: true }),\n  interval: 1000,\n});\n\n/**\n * Registering the provider with the API allows it to be discovered\n * and used by instrumentation libraries.\n */\napi.metrics.setGlobalMeterProvider(meterProvider);\n```\n\n## Version Compatibility\n\nBecause the npm installer and node module resolution algorithm could potentially allow two or more copies of any given package to exist within the same `node_modules` structure, the OpenTelemetry API takes advantage of a variable on the `global` object to store the global API. When an API method in the API package is called, it checks if this `global` API exists and proxies calls to it if and only if it is a compatible API version. This means if a package has a dependency on an OpenTelemetry API version which is not compatible with the API used by the end user, the package will receive a no-op implementation of the API.\n\n## Advanced Use\n\n### API Methods\n\nIf you are writing an instrumentation library, or prefer to call the API methods directly rather than using the `register` method on the Tracer/Meter Provider, OpenTelemetry provides direct access to the underlying API methods through the `@opentelemetry/api-metrics` package. API entry points are defined as global singleton objects `trace`, `metrics`, `propagation`, and `context` which contain methods used to initialize SDK implementations and acquire resources from the API.\n\n- [Metrics API Documentation][metrics-api-docs]\n\n```javascript\nconst api = require(\"@opentelemetry/api-metrics\");\n\n/* Initialize MeterProvider */\napi.metrics.setGlobalMeterProvider(meterProvider);\n/* returns meterProvider (no-op if a working provider has not been initialized) */\napi.metrics.getMeterProvider();\n/* returns a meter from the registered global meter provider (no-op if a working provider has not been initialized) */\napi.metrics.getMeter(name, version);\n```\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-api-metrics\n[dependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-api-metrics\n[devDependencies-image]: https://status.david-dm.org/gh/open-telemetry/opentelemetry-js.svg?path=packages%2Fopentelemetry-api-metrics&type=dev\n[devDependencies-url]: https://david-dm.org/open-telemetry/opentelemetry-js?path=packages%2Fopentelemetry-api-metrics&type=dev\n[npm-url]: https://www.npmjs.com/package/@opentelemetry/api-metrics\n[npm-img]: https://badge.fury.io/js/%40opentelemetry%2Fapi-metrics.svg\n\n[trace-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/traceapi.html\n[metrics-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/metricsapi.html\n[propagation-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/propagationapi.html\n[context-api-docs]: https://open-telemetry.github.io/opentelemetry-js/classes/contextapi.html\n\n[web]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-web\n[tracing]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-base\n[node]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-trace-node\n[metrics]: https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-sdk-metrics-base\n\n[other-tracing-backends]: https://github.com/open-telemetry/opentelemetry-js#trace-exporters\n","browser":{"./src/platform/index.ts":"./src/platform/browser/index.ts","./build/esm/platform/index.js":"./build/esm/platform/browser/index.js","./build/src/platform/index.js":"./build/src/platform/browser/index.js"},"engines":{"node":">=8.0.0"},"gitHead":"0ef1fc28d366b74d98b73b5d6334ffdc75342fe2","license":"Apache-2.0","scripts":{"lint":"eslint . --ext .ts","test":"nyc ts-mocha -p tsconfig.json test/**/*.test.ts","build":"npm run compile","clean":"tsc --build --clean tsconfig.json tsconfig.esm.json","watch":"tsc --build --watch tsconfig.json tsconfig.esm.json","codecov":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../","compile":"tsc --build tsconfig.json tsconfig.esm.json","version":"node ../../scripts/version-update.js","lint:fix":"eslint . --ext .ts --fix","test:browser":"nyc karma start --single-run","codecov:browser":"nyc report --reporter=json && codecov -f coverage/*.json -p ../../"},"_npmUser":{"name":"dyladan","email":"dyladan@gmail.com"},"homepage":"https://github.com/open-telemetry/opentelemetry-js#readme","keywords":["opentelemetry","nodejs","browser","profiling","metrics","stats","monitoring"],"deprecated":"Please use @opentelemetry/api >= 1.3.0","repository":{"url":"git+https://github.com/open-telemetry/opentelemetry-js.git","type":"git"},"_npmVersion":"lerna/3.22.1/node@v14.8.0+x64 (darwin)","description":"Public metrics API for OpenTelemetry","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"}],"_nodeVersion":"14.8.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"15.1.0","karma":"5.2.3","mocha":"7.2.0","codecov":"3.8.3","webpack":"4.46.0","ts-mocha":"8.0.0","ts-loader":"8.3.0","typescript":"4.3.5","@types/node":"14.17.9","karma-mocha":"2.0.1","@types/mocha":"8.2.3","karma-webpack":"4.0.2","@opentelemetry/api":"^1.0.2","@types/webpack-env":"1.16.2","karma-spec-reporter":"0.0.32","karma-chrome-launcher":"3.1.0","istanbul-instrumenter-loader":"3.0.1","karma-coverage-istanbul-reporter":"3.0.3"},"peerDependencies":{"@opentelemetry/api":"^1.0.2"},"_npmOperationalInternal":{"tmp":"tmp/api-metrics_0.25.0_1629321396487_0.1194416442179822","host":"s3://npm-registry-packages"},"_id":"@opentelemetry/api-metrics@0.25.0","version":"0.25.0"}