{"name":"@sentry/tracing","version":"5.22.2","author":{"name":"Sentry"},"license":"MIT","_id":"@sentry/tracing@5.22.2","homepage":"https://github.com/getsentry/sentry-javascript/tree/master/packages/tracing","bugs":{"url":"https://github.com/getsentry/sentry-javascript/issues"},"dist":{"shasum":"6a326bf43b3491c3e462330f8e7d6cd52a975a2d","tarball":"http://registry-npm.ywwl.com/@sentry/tracing/download/@sentry/tracing-5.22.2.tgz","fileCount":143,"integrity":"sha512-M4F4CN85luWoHBuBiQMk2/dtpn5L2CriBTcLsKQNkA/fk6lv8CbE1WZ/SkCMWzK4hxo5I2vSyzLlb2OwcMHmdQ==","signatures":[{"sig":"MEUCIEOtkILEI76mb3FzUlIzd+ZjzUgACOjZLC9XcP7FmepxAiEAgOdPcmo5enDP/oCAGUEjDijy9Sb0xR1ihQ9k9o3LUn4=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":1597341,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfSQuVCRA9TVsSAnZWagAAscAP/RaDVMSJI1DLz7SBSH4t\n4rNk6Q1uk2+1TUGeGk96L4RQImp79Q5K9I6CVCSUytZGyykoPTaQGDuUceBA\nl6o00gpAEo43LQlnRtS81FnWRM/6V11lT2IQvj99lwQy563nu19iSH8RLc11\nPBLEtcZ1n3C3EH8z8TvGh0mUauR8SOUvYrOC2Uv7smBTL6MBaz8N3lWUMmVv\nz+QhmYzSDmbwLHRyRI47Y0bPEkOe6CbQBBaUSTG/qMNX6ziNAJY8EuWph7Fx\nL5bFO9h+TvEZ+Obfo2a8UKmbJ8mSZKU4/vkhk4dWFCD8HraN1UeTiJnYpzhL\nSKZQfz5n4qgZ4MuUTcB5DPi5gtRwsDKyRxzBI9idS86FYjaLVnXqn0WpXASm\nAdHifxikj8kYA8zHkHWBgj+aaxmLv001SyJfl9wycCODD3pfQ+49I+xVtAVl\n4SarLoZRRNO8dpUfLTrlw7+aCFlwo16/lWF75uUpcUhviEg6LZt5/unjc/Jy\nIlid6dvyKjdmdDQmkvpIUE2ApsTb45U3y9U7HhZZ7/siB5kt6ZhgtT1kjKTl\nZYz9Bqv6wGC4S+sRAP1ZYD4MaiYerOKaVqPCYGjA6OzWRE6Xik/f6HbjDrkW\nSuEWAkVtQX+5Qq8wOeMbw0R282c8oSlE22pT7bX/zEgL7PmP/Dhj+pu1Wj0Q\nDD8T\r\n=V+vL\r\n-----END PGP SIGNATURE-----\r\n","size":347911,"noattachment":false,"key":"/@sentry/tracing/-/@sentry/tracing-5.22.2.tgz"},"jest":{"globals":{"ts-jest":{"tsConfig":"./tsconfig.json","diagnostics":false}},"testMatch":["**/*.test.ts"],"transform":{"^.+\\.ts$":"ts-jest"},"collectCoverage":true,"testEnvironment":"node","moduleFileExtensions":["js","ts"]},"main":"dist/index.js","_from":"file:/var/folders/7d/4fxc2_s94_z6ygyf5yk74t700000gn/T/craft-TJI0FT/sentry-tracing-5.22.2.tgz","types":"dist/index.d.ts","module":"esm/index.js","engines":{"node":">=6"},"scripts":{"fix":"run-s fix:eslint fix:prettier","lint":"run-s lint:prettier lint:eslint","pack":"npm pack","test":"jest","build":"run-p build:es5 build:esm build:bundle","clean":"rimraf dist coverage build esm","build:es5":"tsc -p tsconfig.build.json","build:esm":"tsc -p tsconfig.esm.json","link:yarn":"yarn link","fix:eslint":"eslint . --format stylish --fix","test:watch":"jest --watch","build:watch":"run-p build:watch:es5 build:watch:esm","lint:eslint":"eslint . --cache --cache-location '../../eslintcache/' --format stylish","build:bundle":"rollup --config","fix:prettier":"prettier --write \"{src,test}/**/*.ts\"","lint:prettier":"prettier --check \"{src,test}/**/*.ts\"","build:watch:es5":"tsc -p tsconfig.build.json -w --preserveWatchOutput","build:watch:esm":"tsc -p tsconfig.esm.json -w --preserveWatchOutput","build:bundle:watch":"rollup --config --watch"},"_npmUser":{"name":"haza","email":"daniel.griesser.86@gmail.com"},"_resolved":"","_integrity":"","repository":{"url":"git://github.com/getsentry/sentry-javascript.git","type":"git"},"_npmVersion":"6.14.7","description":"Extensions for Sentry AM","directories":{},"sideEffects":["./src/index.ts"],"_nodeVersion":"14.8.0","dependencies":{"tslib":"^1.9.3","@sentry/hub":"5.22.2","@sentry/types":"5.22.2","@sentry/utils":"5.22.2","@sentry/minimal":"5.22.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^24.7.1","jsdom":"^16.2.2","eslint":"7.6.0","rimraf":"^2.6.3","rollup":"^1.10.1","prettier":"1.19.0","typescript":"3.7.5","npm-run-all":"^4.1.2","@types/jsdom":"^16.2.3","@types/express":"^4.17.1","@sentry/browser":"5.22.2","rollup-plugin-terser":"^4.0.4","rollup-plugin-license":"^0.8.1","rollup-plugin-commonjs":"^9.3.4","rollup-plugin-typescript2":"^0.21.0","rollup-plugin-node-resolve":"^4.2.3","@sentry-internal/eslint-config-sdk":"5.22.2"},"_npmOperationalInternal":{"tmp":"tmp/tracing_5.22.2_1598622605096_0.963694033367194","host":"s3://npm-registry-packages"},"readme":"<p align=\"center\">\n  <a href=\"https://sentry.io/?utm_source=github&utm_medium=logo\" target=\"_blank\">\n    <img src=\"https://sentry-brand.storage.googleapis.com/sentry-wordmark-dark-280x84.png\" alt=\"Sentry\" width=\"280\" height=\"84\">\n  </a>\n</p>\n\n> ⚠️ **Deprecation Notice:** From SDK versions >= `7.47.0` onwards, the `@sentry/tracing` package is officially\n> deprecated. This package will be removed in a future major release. More details can be found in the\n> [migration docs](https://github.com/getsentry/sentry-javascript/blob/7.47.0/MIGRATION.md/#remove-requirement-for-sentrytracing-package-since-7460).\n\n# Sentry Tracing Extensions\n\n[![npm version](https://img.shields.io/npm/v/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n[![npm dm](https://img.shields.io/npm/dm/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n[![npm dt](https://img.shields.io/npm/dt/@sentry/tracing.svg)](https://www.npmjs.com/package/@sentry/tracing)\n\n## Package Discontinued\n\nThis package was discontinued with version 8.0.0 of the Sentry JavaScript SDKs. Instead, exports from this package are\nexported directly from the main SDK packages like `@sentry/react` or `@sentry/node`. For more information have a look at\nthe [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#sentrytracing).\n\n## Links\n\n- [Official SDK Docs](https://docs.sentry.io/quickstart/)\n- [TypeDoc](http://getsentry.github.io/sentry-javascript/)\n\n## General\n\nThis package contains extensions to the `@sentry/hub` to enable Sentry AM related functionality. It also provides\nintegrations for Browser and Node that provide a good experience out of the box.\n\n## Migrating from @sentry/apm to @sentry/tracing\n\nThe tracing integration for JavaScript SDKs has moved from [`@sentry/apm`](https://www.npmjs.com/package/@sentry/apm) to\n[`@sentry/tracing`](https://www.npmjs.com/package/@sentry/tracing). While the two packages are similar, some imports and\nAPIs have changed slightly.\n\nThe old package `@sentry/apm` is deprecated in favor of `@sentry/tracing`. Future support for `@sentry/apm` is limited\nto bug fixes only.\n\n## Migrating from @sentry/apm to @sentry/tracing\n\n### Browser (CDN bundle)\n\nIf you were using the Browser CDN bundle, switch from the old `bundle.apm.min.js` to the new tracing bundle:\n\n```html\n<script\n  src=\"https://browser.sentry-cdn.com/{{ packages.version('sentry.javascript.browser') }}/bundle.tracing.min.js\"\n  integrity=\"sha384-{{ packages.checksum('sentry.javascript.browser', 'bundle.tracing.min.js', 'sha384-base64') }}\"\n  crossorigin=\"anonymous\"\n></script>\n```\n\nAnd then update `Sentry.init`:\n\n```diff\n Sentry.init({\n-  integrations: [new Sentry.Integrations.Tracing()]\n+  integrations: [new Sentry.Integrations.BrowserTracing()]\n });\n```\n\n### Browser (npm package)\n\nIf you were using automatic instrumentation, update the import statement and update `Sentry.init` to use the new\n`BrowserTracing` integration:\n\n```diff\n import * as Sentry from \"@sentry/browser\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n-    new Integrations.Tracing(),\n+    new Integrations.BrowserTracing(),\n   ]\n });\n```\n\nIf you were using the `beforeNavigate` option from the `Tracing` integration, the API in `BrowserTracing` has changed\nslightly. Instead of passing in a location and returning a string representing transaction name, `beforeNavigate` now\naccepts a transaction context and is expected to return a transaction context. You can now add extra tags or change the\n`op` based on different parameters. If you want to access the location like before, you can get it from\n`window.location`.\n\nFor example, if you had a function like so that computed a custom transaction name:\n\n```javascript\nimport * as Sentry from '@sentry/browser';\nimport { Integrations } from '@sentry/apm';\n\nSentry.init({\n  integrations: [\n    new Integrations.Tracing({\n      beforeNavigate: location => {\n        return getTransactionName(location);\n      },\n    }),\n  ],\n});\n```\n\nYou would now leverage the context to do the same thing:\n\n```javascript\nimport * as Sentry from '@sentry/browser';\nimport { Integrations } from '@sentry/tracing';\n\nSentry.init({\n  integrations: [\n    new Integrations.BrowserTracing({\n      beforeNavigate: context => {\n        return {\n          ...context,\n          // Can even look at context tags or other data to adjust\n          // transaction name\n          name: getTransactionName(window.location),\n        };\n      },\n    }),\n  ],\n});\n```\n\nFor the full diff:\n\n```diff\n import * as Sentry from \"@sentry/browser\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n-    new Integrations.Tracing({\n-      beforeNavigate: (location) => {\n-        return getTransactionName(location)\n+    new Integrations.BrowserTracing({\n+      beforeNavigate: (ctx) => {\n+        return {\n+          ...ctx,\n+          name: getTransactionName(ctx.name, window.location)\n+        }\n       }\n     }),\n   ]\n });\n```\n\n### Node\n\nIf you were using the Express integration for automatic instrumentation, the only necessary change is to update the\nimport statement:\n\n```diff\n import * as Sentry from \"@sentry/node\";\n-import { Integrations } from \"@sentry/apm\";\n+import { Integrations } from \"@sentry/tracing\";\n\n Sentry.init({\n   integrations: [\n     new Integrations.Express(),\n   ]\n });\n```\n","publish_time":1598622612714,"maintainers":[{"name":"benvinegar","email":"ben@benv.ca"},{"name":"billyvg","email":"npm@mmo.me"},{"name":"mitsuhiko","email":"armin.ronacher@active-4.com"},{"name":"haza","email":"daniel.griesser.86@gmail.com"},{"name":"jauer","email":"account@jauer.org"},{"name":"sentry-bot","email":"accounts@sentry.io"},{"name":"evanpurkhiser","email":"evanpurkhiser@gmail.com"},{"name":"lynnagara","email":"lyn.nagara@gmail.com"},{"name":"leedongwei","email":"danny@dongwei.li"},{"name":"markstory","email":"mark@mark-story.com"},{"name":"zeeg","email":"dcramer@gmail.com"}],"_cnpm_publish_time":1598622612714,"dist-tags":{"latest":"7.120.4","next":"7.120.4-alpha.1","v7":"7.120.2"}}