diff --git a/packages/web/instrumentation.ts b/packages/web/instrumentation.ts new file mode 100644 index 0000000000..bf60596340 --- /dev/null +++ b/packages/web/instrumentation.ts @@ -0,0 +1,7 @@ +import { registerOTel } from "@vercel/otel"; + +export function register() { + registerOTel({ + serviceName: "osmosis-frontend", + }); +} diff --git a/packages/web/next.config.js b/packages/web/next.config.js index 8e3af0d46a..bd864d27c1 100644 --- a/packages/web/next.config.js +++ b/packages/web/next.config.js @@ -79,6 +79,9 @@ const config = { return config; }, + experimental: { + instrumentationHook: true, + }, }; const withBundleAnalyzer = require("@next/bundle-analyzer")({ diff --git a/packages/web/package.json b/packages/web/package.json index 2b49bbd399..1ac56853d3 100644 --- a/packages/web/package.json +++ b/packages/web/package.json @@ -51,6 +51,7 @@ "@keplr-wallet/wc-client": "0.10.24-ibc.go.v7.hot.fix", "@metamask/onboarding": "^1.0.1", "@next/bundle-analyzer": "^12.1.6", + "@opentelemetry/api": "^1.9.0", "@osmosis-labs/bridge": "^1.0.0", "@osmosis-labs/keplr-hooks": "0.10.24-ibc.go.v7.hot.fix", "@osmosis-labs/keplr-stores": "0.10.24-ibc.go.v7.hot.fix", @@ -84,6 +85,7 @@ "@trpc/next": "^10.45.1", "@trpc/react-query": "^10.45.1", "@trpc/server": "^10.45.1", + "@vercel/otel": "^1.9.1", "@visx/curve": "^2.17.0", "@visx/gradient": "^3.3.0", "@visx/responsive": "^2.17.0", diff --git a/yarn.lock b/yarn.lock index 9bcffb97d5..8d7e38c886 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5717,6 +5717,11 @@ resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca" integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q== +"@opentelemetry/api@^1.9.0": + version "1.9.0" + resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe" + integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg== + "@parcel/watcher-android-arm64@2.4.1": version "2.4.1" resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.4.1.tgz#c2c19a3c442313ff007d2d7a9c2c1dd3e1c9ca84" @@ -7766,6 +7771,11 @@ dependencies: crypto-js "^4.2.0" +"@vercel/otel@^1.9.1": + version "1.9.1" + resolved "https://registry.yarnpkg.com/@vercel/otel/-/otel-1.9.1.tgz#5ec83247f307738c95a0c7ddd3993fe4a0aac719" + integrity sha512-ZSTqgvd+w/lcB1nxEW8EHSBBqd4ZdeJ1t5op1CFo/nKFdG/EshwMon0qKc2ZxVEZXOZJI/x+LKf8Y5/Y/VHqEA== + "@visx/annotation@2.18.0": version "2.18.0" resolved "https://registry.npmjs.org/@visx/annotation/-/annotation-2.18.0.tgz"