Skip to content

Commit

Permalink
Merge pull request #536 from desci-labs/sentry-traces
Browse files Browse the repository at this point in the history
update sentry tracing to log db and http reqs in sentry
  • Loading branch information
hubsmoke authored Sep 28, 2024
2 parents f20e5c0 + 7995fc2 commit 1d1ea7f
Show file tree
Hide file tree
Showing 4 changed files with 156 additions and 8 deletions.
1 change: 1 addition & 0 deletions desci-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@sendgrid/mail": "^7.7.0",
"@sentry/cli": "^2.35.0",
"@sentry/node": "^8.29.0",
"@sentry/profiling-node": "^8.32.0",
"@sentry/tracing": "^7.12.0",
"@types/lodash-es": "^4.17.12",
"@types/mkdirp": "^1.0.2",
Expand Down
3 changes: 2 additions & 1 deletion desci-server/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
generator client {
provider = "prisma-client-js"
provider = "prisma-client-js"
previewFeatures = ["tracing"]
}

datasource db {
Expand Down
3 changes: 2 additions & 1 deletion desci-server/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { Server as HttpServer } from 'http';
// import path from 'path';

import * as Sentry from '@sentry/node';
import { nodeProfilingIntegration } from '@sentry/profiling-node';
import * as Tracing from '@sentry/tracing';
import bodyParser from 'body-parser';
import cookieParser from 'cookie-parser';
Expand Down Expand Up @@ -224,7 +225,7 @@ class AppServer {
Sentry.init({
dsn: 'https://d508a5c408f34b919ccd94aac093e076@o1330109.ingest.sentry.io/6619754',
release: 'desci-nodes-server@' + process.env.npm_package_version,
integrations: [new Tracing.Integrations.Prisma({ client: prisma })],
integrations: [Sentry.prismaIntegration(), nodeProfilingIntegration()],
// Set tracesSampleRate to 1.0 to capture 100%
// of transactions for performance monitoring.
// We recommend adjusting this value in production
Expand Down
157 changes: 151 additions & 6 deletions desci-server/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3922,6 +3922,15 @@
"@opentelemetry/instrumentation" "^0.40.0"
"@opentelemetry/semantic-conventions" "^1.0.0"

"@opentelemetry/instrumentation-amqplib@^0.42.0":
version "0.42.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-amqplib/-/instrumentation-amqplib-0.42.0.tgz#b3cab5a7207736a30d769962eed3af3838f986c4"
integrity sha512-fiuU6OKsqHJiydHWgTRQ7MnIrJ2lEqsdgFtNIH4LbAUJl/5XmrIeoDzDnox+hfkgWK65jsleFuQDtYb5hW1koQ==
dependencies:
"@opentelemetry/core" "^1.8.0"
"@opentelemetry/instrumentation" "^0.53.0"
"@opentelemetry/semantic-conventions" "^1.27.0"

"@opentelemetry/instrumentation-aws-lambda@^0.35.3":
version "0.35.3"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-aws-lambda/-/instrumentation-aws-lambda-0.35.3.tgz#19c42ba680f93a595a38edb06b28bac2b7da6f92"
Expand Down Expand Up @@ -3979,6 +3988,13 @@
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/connect" "3.4.35"

"@opentelemetry/instrumentation-dataloader@0.12.0":
version "0.12.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.12.0.tgz#de03a3948dec4f15fed80aa424d6bd5d6a8d10c7"
integrity sha512-pnPxatoFE0OXIZDQhL2okF//dmbiWFzcSc8pUg9TqofCLYZySSxDCgQc69CJBo5JnI3Gz1KP+mOjS4WAeRIH4g==
dependencies:
"@opentelemetry/instrumentation" "^0.53.0"

"@opentelemetry/instrumentation-dataloader@^0.4.3":
version "0.4.3"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-dataloader/-/instrumentation-dataloader-0.4.3.tgz#13d2041d44d8ff4b9ebfc48bcbf9cbda74b61d00"
Expand Down Expand Up @@ -4145,6 +4161,14 @@
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/ioredis4" "npm:@types/ioredis@^4.28.10"

"@opentelemetry/instrumentation-kafkajs@0.3.0":
version "0.3.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-kafkajs/-/instrumentation-kafkajs-0.3.0.tgz#6687bce4dac8b90ef8ccbf1b662d5d1e95a34414"
integrity sha512-UnkZueYK1ise8FXQeKlpBd7YYUtC7mM8J0wzUSccEfc/G8UqHQqAzIyYCUOUPUKp8GsjLnWOOK/3hJc4owb7Jg==
dependencies:
"@opentelemetry/instrumentation" "^0.53.0"
"@opentelemetry/semantic-conventions" "^1.27.0"

"@opentelemetry/instrumentation-knex@^0.31.4":
version "0.31.4"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-knex/-/instrumentation-knex-0.31.4.tgz#15c747acf3de94f15bbad852140ec584b79d5cd9"
Expand Down Expand Up @@ -4374,6 +4398,14 @@
"@opentelemetry/semantic-conventions" "^1.0.0"
"@types/tedious" "^4.0.6"

"@opentelemetry/instrumentation-undici@0.6.0":
version "0.6.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-undici/-/instrumentation-undici-0.6.0.tgz#9436ee155c8dcb0b760b66947c0e0f347688a5ef"
integrity sha512-ABJBhm5OdhGmbh0S/fOTE4N69IZ00CsHC5ijMYfzbw3E5NwLgpQk5xsljaECrJ8wz1SfXbO03FiSuu5AyRAkvQ==
dependencies:
"@opentelemetry/core" "^1.8.0"
"@opentelemetry/instrumentation" "^0.53.0"

"@opentelemetry/instrumentation-winston@^0.31.4":
version "0.31.4"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-winston/-/instrumentation-winston-0.31.4.tgz#09c160dfeb935ea6981d898176be79dea67f31c8"
Expand Down Expand Up @@ -4646,7 +4678,7 @@
"@opentelemetry/core" "1.25.0"
"@opentelemetry/semantic-conventions" "1.25.0"

"@opentelemetry/resources@1.26.0", "@opentelemetry/resources@^1.25.1":
"@opentelemetry/resources@1.26.0", "@opentelemetry/resources@^1.25.1", "@opentelemetry/resources@^1.26.0":
version "1.26.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/resources/-/resources-1.26.0.tgz#da4c7366018bd8add1f3aa9c91c6ac59fd503cef"
integrity sha512-CPNYchBE7MBecCSVy0HKpUISEeJOniWqcHaAHpmasZ3j9o6V3AyBzhRc90jdmemq0HOxDr6ylhUbDhBqqPpeNw==
Expand Down Expand Up @@ -4786,7 +4818,7 @@
"@opentelemetry/resources" "1.8.0"
"@opentelemetry/semantic-conventions" "1.8.0"

"@opentelemetry/sdk-trace-base@^1.22", "@opentelemetry/sdk-trace-base@^1.25.1":
"@opentelemetry/sdk-trace-base@^1.22", "@opentelemetry/sdk-trace-base@^1.25.1", "@opentelemetry/sdk-trace-base@^1.26.0":
version "1.26.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/sdk-trace-base/-/sdk-trace-base-1.26.0.tgz#0c913bc6d2cfafd901de330e4540952269ae579c"
integrity sha512-olWQldtvbK4v22ymrKLbIcBi9L2SpMO84sCPY54IVsJhP9fRsxJT194C/AVaAuJzLE30EdhhM1VmvVYR7az+cw==
Expand Down Expand Up @@ -5685,6 +5717,54 @@
"@sentry/types" "8.29.0"
"@sentry/utils" "8.29.0"

"@sentry/core@8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-8.32.0.tgz#7c4b74afa7a15bd31f5e6881aac82ccfd753e1d6"
integrity sha512-+xidTr0lZ0c755tq4k75dXPEb8PA+qvIefW3U9+dQMORLokBrYoKYMf5zZTG2k/OfSJS6OSxatUj36NFuCs3aA==
dependencies:
"@sentry/types" "8.32.0"
"@sentry/utils" "8.32.0"

"@sentry/node@8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.32.0.tgz#68822b3246fb2ed7418f21795ed539a18058cfa8"
integrity sha512-a2PoFA9j/HmJVGF/zXJhLP6QhRHGye/2EznQdHOELsH1BkeMgBaXl7D52r2E/b7qki647lXrdbspB6jid8NycA==
dependencies:
"@opentelemetry/api" "^1.9.0"
"@opentelemetry/context-async-hooks" "^1.25.1"
"@opentelemetry/core" "^1.25.1"
"@opentelemetry/instrumentation" "^0.53.0"
"@opentelemetry/instrumentation-amqplib" "^0.42.0"
"@opentelemetry/instrumentation-connect" "0.39.0"
"@opentelemetry/instrumentation-dataloader" "0.12.0"
"@opentelemetry/instrumentation-express" "0.42.0"
"@opentelemetry/instrumentation-fastify" "0.39.0"
"@opentelemetry/instrumentation-fs" "0.15.0"
"@opentelemetry/instrumentation-generic-pool" "0.39.0"
"@opentelemetry/instrumentation-graphql" "0.43.0"
"@opentelemetry/instrumentation-hapi" "0.41.0"
"@opentelemetry/instrumentation-http" "0.53.0"
"@opentelemetry/instrumentation-ioredis" "0.43.0"
"@opentelemetry/instrumentation-kafkajs" "0.3.0"
"@opentelemetry/instrumentation-koa" "0.43.0"
"@opentelemetry/instrumentation-mongodb" "0.47.0"
"@opentelemetry/instrumentation-mongoose" "0.42.0"
"@opentelemetry/instrumentation-mysql" "0.41.0"
"@opentelemetry/instrumentation-mysql2" "0.41.0"
"@opentelemetry/instrumentation-nestjs-core" "0.40.0"
"@opentelemetry/instrumentation-pg" "0.44.0"
"@opentelemetry/instrumentation-redis-4" "0.42.0"
"@opentelemetry/instrumentation-undici" "0.6.0"
"@opentelemetry/resources" "^1.26.0"
"@opentelemetry/sdk-trace-base" "^1.26.0"
"@opentelemetry/semantic-conventions" "^1.27.0"
"@prisma/instrumentation" "5.19.1"
"@sentry/core" "8.32.0"
"@sentry/opentelemetry" "8.32.0"
"@sentry/types" "8.32.0"
"@sentry/utils" "8.32.0"
import-in-the-middle "^1.11.0"

"@sentry/node@^8.29.0":
version "8.29.0"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-8.29.0.tgz#6e462b8802356a630c56733dc795a4035464c4ab"
Expand Down Expand Up @@ -5732,6 +5812,27 @@
"@sentry/types" "8.29.0"
"@sentry/utils" "8.29.0"

"@sentry/opentelemetry@8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/opentelemetry/-/opentelemetry-8.32.0.tgz#4af02c17102635e4b34942d2e82d3620ddb7d95a"
integrity sha512-YCD8EnwJJ2ab3zWWtu5VrvHP/6Ss6GGQH0TYx2cfeGG3c0wTA/5zYx9JR4i3hUtOh1pifN34HlY0yyQHD4yctg==
dependencies:
"@sentry/core" "8.32.0"
"@sentry/types" "8.32.0"
"@sentry/utils" "8.32.0"

"@sentry/profiling-node@^8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/profiling-node/-/profiling-node-8.32.0.tgz#cb4bf0512dc7a6f0a9058529f3c4dbb8963a597d"
integrity sha512-wKE2JAvDM3DjVNFKd2YLzwhXFS3SurLxDPpvA1EjMQ9Me7sR5ssO9jFn3e6et5oT3e3EzGDyTfbrJ81BNQuZhQ==
dependencies:
"@sentry/core" "8.32.0"
"@sentry/node" "8.32.0"
"@sentry/types" "8.32.0"
"@sentry/utils" "8.32.0"
detect-libc "^2.0.2"
node-abi "^3.61.0"

"@sentry/tracing@^7.12.0":
version "7.106.1"
resolved "https://registry.yarnpkg.com/@sentry/tracing/-/tracing-7.106.1.tgz#1142fa308f7cb90f16291b969b2d5fb14c1858ae"
Expand All @@ -5749,6 +5850,11 @@
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.29.0.tgz#c19e43524b8e7766028f4da8f02eddcc33518541"
integrity sha512-j4gX3ctzgD4xVWllXAhm6M+kHFEvrFoUPFq60X/pgkjsWCocGuhtNfB0rW43ICG8hCnlz8IYl7O7b8V8qY7SPg==

"@sentry/types@8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-8.32.0.tgz#dfd8aa9449a5f793b9c720888819a74a11f1790d"
integrity sha512-hxckvN2MzS5SgGDgVQ0/QpZXk13Vrq4BtZLwXhPhyeTmZtUiUfWvcL5TFQqLinfKdTKPe9q2MxeAJ0D4LalhMg==

"@sentry/utils@7.106.1":
version "7.106.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-7.106.1.tgz#7761ed50d489286dd1e482570c498f675445ce82"
Expand All @@ -5763,6 +5869,13 @@
dependencies:
"@sentry/types" "8.29.0"

"@sentry/utils@8.32.0":
version "8.32.0"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-8.32.0.tgz#99a4298ee8fd7208ade470931c19d71c571dfce8"
integrity sha512-t1WVERhgmYURxbBj9J4/H2P2X+VKqm7B3ce9iQyrZbdf5NekhcU4jHIecPUWCPHjQkFIqkVTorqeBmDTlg/UmQ==
dependencies:
"@sentry/types" "8.32.0"

"@sideway/address@^4.1.5":
version "4.1.5"
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.5.tgz#4bc149a0076623ced99ca8208ba780d65a99b9d5"
Expand Down Expand Up @@ -9905,7 +10018,7 @@ detect-indent@6.1.0:
resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-6.1.0.tgz#592485ebbbf6b3b1ab2be175c8393d04ca0d57e6"
integrity sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==

detect-libc@^2.0.0:
detect-libc@^2.0.0, detect-libc@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-2.0.3.tgz#f0cd503b40f9939b894697d19ad50895e30cf700"
integrity sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==
Expand Down Expand Up @@ -13929,6 +14042,13 @@ node-abi@^3.3.0:
dependencies:
semver "^7.3.5"

node-abi@^3.61.0:
version "3.68.0"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.68.0.tgz#8f37fb02ecf4f43ebe694090dcb52e0c4cc4ba25"
integrity sha512-7vbj10trelExNjFSBm5kTvZXXa7pZyKWx9RCKIyqe6I9Ev3IzGpQoqBP3a+cOdxY+pWj6VkP28n/2wWysBHD/A==
dependencies:
semver "^7.3.5"

node-addon-api@^2.0.0:
version "2.0.2"
resolved "https://registry.yarnpkg.com/node-addon-api/-/node-addon-api-2.0.2.tgz#432cfa82962ce494b132e9d72a15b29f71ff5d32"
Expand Down Expand Up @@ -16207,7 +16327,16 @@ string-template@~0.2.1:
resolved "https://registry.yarnpkg.com/string-template/-/string-template-0.2.1.tgz#42932e598a352d01fc22ec3367d9d84eec6c9add"
integrity sha512-Yptehjogou2xm4UJbxJ4CxgZx12HBfeystp0y3x7s4Dj32ltVVG1Gg8YhKjHZkHicuKpZX/ffilA8505VbUbpw==

"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
"string-width-cjs@npm:string-width@^4.2.0":
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"

"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
version "4.2.3"
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
Expand Down Expand Up @@ -16280,7 +16409,7 @@ stringify-object@3.3.0:
is-obj "^1.0.1"
is-regexp "^1.0.0"

"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
Expand All @@ -16294,6 +16423,13 @@ strip-ansi@^3.0.0:
dependencies:
ansi-regex "^2.0.0"

strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"

strip-ansi@^7.0.1:
version "7.1.0"
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-7.1.0.tgz#d5b6568ca689d8561370b0707685d22434faff45"
Expand Down Expand Up @@ -17329,7 +17465,7 @@ workerpool@6.2.1:
resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.2.1.tgz#46fc150c17d826b86a008e5a4508656777e9c343"
integrity sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==

"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0:
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
Expand All @@ -17347,6 +17483,15 @@ wrap-ansi@^6.2.0:
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"

wrap-ansi@^8.1.0:
version "8.1.0"
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-8.1.0.tgz#56dc22368ee570face1b49819975d9b9a5ead214"
Expand Down

0 comments on commit 1d1ea7f

Please sign in to comment.