Skip to content

Commit bf72904

Browse files
authored
feat(node-experimental): Add hapi tracing support (#9449)
This adds experimental support to auto instrument hapi performance.
1 parent 10fb09a commit bf72904

File tree

4 files changed

+185
-0
lines changed

4 files changed

+185
-0
lines changed

packages/node-experimental/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@opentelemetry/instrumentation-express": "0.33.2",
3131
"@opentelemetry/instrumentation-fastify": "0.32.3",
3232
"@opentelemetry/instrumentation-graphql": "0.35.2",
33+
"@opentelemetry/instrumentation-hapi": "0.33.1",
3334
"@opentelemetry/instrumentation-http": "0.44.0",
3435
"@opentelemetry/instrumentation-mongodb": "0.37.1",
3536
"@opentelemetry/instrumentation-mongoose": "0.33.2",

packages/node-experimental/src/integrations/getAutoPerformanceIntegrations.ts

+4
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { Integration } from '@sentry/types';
33
import { Express } from './express';
44
import { Fastify } from './fastify';
55
import { GraphQL } from './graphql';
6+
import { Hapi } from './hapi';
67
import { Mongo } from './mongo';
78
import { Mongoose } from './mongoose';
89
import { Mysql } from './mysql';
@@ -43,6 +44,9 @@ const INTEGRATIONS: (() => NodePerformanceIntegration<unknown>)[] = [
4344
() => {
4445
return new Nest();
4546
},
47+
() => {
48+
return new Hapi();
49+
},
4650
];
4751

4852
/**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import type { Instrumentation } from '@opentelemetry/instrumentation';
2+
import { HapiInstrumentation } from '@opentelemetry/instrumentation-hapi';
3+
import type { Integration } from '@sentry/types';
4+
5+
import { NodePerformanceIntegration } from './NodePerformanceIntegration';
6+
7+
/**
8+
* Hapi integration
9+
*
10+
* Capture tracing data for Hapi.
11+
*/
12+
export class Hapi extends NodePerformanceIntegration<void> implements Integration {
13+
/**
14+
* @inheritDoc
15+
*/
16+
public static id: string = 'Hapi';
17+
18+
/**
19+
* @inheritDoc
20+
*/
21+
public name: string;
22+
23+
public constructor() {
24+
super();
25+
this.name = Hapi.id;
26+
}
27+
28+
/** @inheritDoc */
29+
public setupInstrumentation(): void | Instrumentation[] {
30+
// Has no hook to adjust spans and add origin
31+
return [new HapiInstrumentation()];
32+
}
33+
}

yarn.lock

+147
Original file line numberDiff line numberDiff line change
@@ -3389,18 +3389,89 @@
33893389
"@hapi/boom" "9.x.x"
33903390
"@hapi/hoek" "9.x.x"
33913391

3392+
3393+
version "5.0.0"
3394+
resolved "https://registry.yarnpkg.com/@hapi/b64/-/b64-5.0.0.tgz#b8210cbd72f4774985e78569b77e97498d24277d"
3395+
integrity sha512-ngu0tSEmrezoiIaNGG6rRvKOUkUuDdf4XTPnONHGYfSGRmDqPZX5oJL6HAdKTo1UQHECbdB4OzhWrfgVppjHUw==
3396+
dependencies:
3397+
"@hapi/hoek" "9.x.x"
3398+
33923399
33933400
version "9.1.2"
33943401
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.2.tgz#48bd41d67437164a2d636e3b5bc954f8c8dc5e38"
33953402
integrity sha512-uJEJtiNHzKw80JpngDGBCGAmWjBtzxDCz17A9NO2zCi8LLBlb5Frpq4pXwyN+2JQMod4pKz5BALwyneCgDg89Q==
33963403
dependencies:
33973404
"@hapi/hoek" "9.x.x"
33983405

3406+
"@hapi/boom@^9.0.0":
3407+
version "9.1.4"
3408+
resolved "https://registry.yarnpkg.com/@hapi/boom/-/boom-9.1.4.tgz#1f9dad367c6a7da9f8def24b4a986fc5a7bd9db6"
3409+
integrity sha512-Ls1oH8jaN1vNsqcaHVYJrKmgMcKsC1wcp8bujvXrHaAqD2iDYq3HoOwsxwo09Cuda5R5nC0o0IxlrlTuvPuzSw==
3410+
dependencies:
3411+
"@hapi/hoek" "9.x.x"
3412+
3413+
3414+
version "2.1.0"
3415+
resolved "https://registry.yarnpkg.com/@hapi/bourne/-/bourne-2.1.0.tgz#66aff77094dc3080bd5df44ec63881f2676eb020"
3416+
integrity sha512-i1BpaNDVLJdRBEKeJWkVO6tYX6DMFBuwMhSuWqLsY4ufeTKGVuV5rBsUhxPayXqnnWHgXUAmWK16H/ykO5Wj4Q==
3417+
3418+
3419+
version "5.1.0"
3420+
resolved "https://registry.yarnpkg.com/@hapi/cryptiles/-/cryptiles-5.1.0.tgz#655de4cbbc052c947f696148c83b187fc2be8f43"
3421+
integrity sha512-fo9+d1Ba5/FIoMySfMqPBR/7Pa29J2RsiPrl7bkwo5W5o+AN1dAYQRi4SPrPwwVxVGKjgLOEWrsvt1BonJSfLA==
3422+
dependencies:
3423+
"@hapi/boom" "9.x.x"
3424+
33993425
34003426
version "9.2.0"
34013427
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.2.0.tgz#f3933a44e365864f4dad5db94158106d511e8131"
34023428
integrity sha512-sqKVVVOe5ivCaXDWivIJYVSaEgdQK9ul7a4Kity5Iw7u9+wBAPbX1RMSnLLmp7O4Vzj0WOWwMAJsTL00xwaNug==
34033429

3430+
"@hapi/hoek@^9.0.0":
3431+
version "9.3.0"
3432+
resolved "https://registry.yarnpkg.com/@hapi/hoek/-/hoek-9.3.0.tgz#8368869dcb735be2e7f5cb7647de78e167a251fb"
3433+
integrity sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==
3434+
3435+
"@hapi/iron@^6.0.0":
3436+
version "6.0.0"
3437+
resolved "https://registry.yarnpkg.com/@hapi/iron/-/iron-6.0.0.tgz#ca3f9136cda655bdd6028de0045da0de3d14436f"
3438+
integrity sha512-zvGvWDufiTGpTJPG1Y/McN8UqWBu0k/xs/7l++HVU535NLHXsHhy54cfEMdW7EjwKfbBfM9Xy25FmTiobb7Hvw==
3439+
dependencies:
3440+
"@hapi/b64" "5.x.x"
3441+
"@hapi/boom" "9.x.x"
3442+
"@hapi/bourne" "2.x.x"
3443+
"@hapi/cryptiles" "5.x.x"
3444+
"@hapi/hoek" "9.x.x"
3445+
3446+
"@hapi/podium@^4.1.3":
3447+
version "4.1.3"
3448+
resolved "https://registry.yarnpkg.com/@hapi/podium/-/podium-4.1.3.tgz#91e20838fc2b5437f511d664aabebbb393578a26"
3449+
integrity sha512-ljsKGQzLkFqnQxE7qeanvgGj4dejnciErYd30dbrYzUOF/FyS/DOF97qcrT3bhoVwCYmxa6PEMhxfCPlnUcD2g==
3450+
dependencies:
3451+
"@hapi/hoek" "9.x.x"
3452+
"@hapi/teamwork" "5.x.x"
3453+
"@hapi/validate" "1.x.x"
3454+
3455+
3456+
version "5.1.1"
3457+
resolved "https://registry.yarnpkg.com/@hapi/teamwork/-/teamwork-5.1.1.tgz#4d2ba3cac19118a36c44bf49a3a47674de52e4e4"
3458+
integrity sha512-1oPx9AE5TIv+V6Ih54RP9lTZBso3rP8j4Xhb6iSVwPXtAM+sDopl5TFMv5Paw73UnpZJ9gjcrTE1BXrWt9eQrg==
3459+
3460+
"@hapi/topo@^5.0.0":
3461+
version "5.1.0"
3462+
resolved "https://registry.yarnpkg.com/@hapi/topo/-/topo-5.1.0.tgz#dc448e332c6c6e37a4dc02fd84ba8d44b9afb012"
3463+
integrity sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==
3464+
dependencies:
3465+
"@hapi/hoek" "^9.0.0"
3466+
3467+
3468+
version "1.1.3"
3469+
resolved "https://registry.yarnpkg.com/@hapi/validate/-/validate-1.1.3.tgz#f750a07283929e09b51aa16be34affb44e1931ad"
3470+
integrity sha512-/XMR0N0wjw0Twzq2pQOzPBZlDzkekGcoCtzO314BpIEsbXdYGthQUbxgkGDf4nhk1+IPDAsXqWjMohRQYO06UA==
3471+
dependencies:
3472+
"@hapi/hoek" "^9.0.0"
3473+
"@hapi/topo" "^5.0.0"
3474+
34043475
"@humanwhocodes/config-array@^0.5.0":
34053476
version "0.5.0"
34063477
resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.5.0.tgz#1407967d4c6eecd7388f83acf1eaf4d0c6e58ef9"
@@ -4359,6 +4430,16 @@
43594430
dependencies:
43604431
"@opentelemetry/instrumentation" "^0.44.0"
43614432

4433+
"@opentelemetry/[email protected]":
4434+
version "0.33.1"
4435+
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-hapi/-/instrumentation-hapi-0.33.1.tgz#9327f15a0d075153f61d338400b3db618dd3902e"
4436+
integrity sha512-8gwPrIgppbj/prCTK31mGmcBvYESE5J2El6badbCvcUHg6ZSA/i8zo80NrJ6812imtD06Dvm6kfnK5UzlC+smQ==
4437+
dependencies:
4438+
"@opentelemetry/core" "^1.8.0"
4439+
"@opentelemetry/instrumentation" "^0.44.0"
4440+
"@opentelemetry/semantic-conventions" "^1.0.0"
4441+
"@types/hapi__hapi" "20.0.13"
4442+
43624443
"@opentelemetry/[email protected]":
43634444
version "0.44.0"
43644445
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation-http/-/instrumentation-http-0.44.0.tgz#5a3e4b91073f737f054fe42ef591c39c5b3e6394"
@@ -5073,6 +5154,23 @@
50735154
"@sentry/cli" "^1.74.6"
50745155
webpack-sources "^2.0.0 || ^3.0.0"
50755156

5157+
"@sideway/address@^4.1.3":
5158+
version "4.1.4"
5159+
resolved "https://registry.yarnpkg.com/@sideway/address/-/address-4.1.4.tgz#03dccebc6ea47fdc226f7d3d1ad512955d4783f0"
5160+
integrity sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==
5161+
dependencies:
5162+
"@hapi/hoek" "^9.0.0"
5163+
5164+
"@sideway/formula@^3.0.1":
5165+
version "3.0.1"
5166+
resolved "https://registry.yarnpkg.com/@sideway/formula/-/formula-3.0.1.tgz#80fcbcbaf7ce031e0ef2dd29b1bfc7c3f583611f"
5167+
integrity sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==
5168+
5169+
"@sideway/pinpoint@^2.0.0":
5170+
version "2.0.0"
5171+
resolved "https://registry.yarnpkg.com/@sideway/pinpoint/-/pinpoint-2.0.0.tgz#cff8ffadc372ad29fd3f78277aeb29e632cc70df"
5172+
integrity sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==
5173+
50765174
"@sigstore/protobuf-specs@^0.1.0":
50775175
version "0.1.0"
50785176
resolved "https://registry.yarnpkg.com/@sigstore/protobuf-specs/-/protobuf-specs-0.1.0.tgz#957cb64ea2f5ce527cc9cf02a096baeb0d2b99b4"
@@ -5815,6 +5913,39 @@
58155913
dependencies:
58165914
"@types/node" "*"
58175915

5916+
"@types/hapi__catbox@*":
5917+
version "10.2.5"
5918+
resolved "https://registry.yarnpkg.com/@types/hapi__catbox/-/hapi__catbox-10.2.5.tgz#4eb5e2fbb966acd2a3c2e86f935b7de95aceb7dd"
5919+
integrity sha512-vomIMP6dUDSbiasbPglH5LJvnnl8jFmRTjPgPl4l9Vi1L9fto3VXJQZtl8LzyIQUUoocyT5bmvWeYWsVgxAHQg==
5920+
5921+
5922+
version "20.0.13"
5923+
resolved "https://registry.yarnpkg.com/@types/hapi__hapi/-/hapi__hapi-20.0.13.tgz#ea8ce83c192f6e8106f6e76e40f795e7e36d0615"
5924+
integrity sha512-LP4IPfhIO5ZPVOrJo7H8c8Slc0WYTFAUNQX1U0LBPKyXioXhH5H2TawIgxKujIyOhbwoBbpvOsBf6o5+ToJIrQ==
5925+
dependencies:
5926+
"@hapi/boom" "^9.0.0"
5927+
"@hapi/iron" "^6.0.0"
5928+
"@hapi/podium" "^4.1.3"
5929+
"@types/hapi__catbox" "*"
5930+
"@types/hapi__mimos" "*"
5931+
"@types/hapi__shot" "*"
5932+
"@types/node" "*"
5933+
joi "^17.3.0"
5934+
5935+
"@types/hapi__mimos@*":
5936+
version "4.1.4"
5937+
resolved "https://registry.yarnpkg.com/@types/hapi__mimos/-/hapi__mimos-4.1.4.tgz#4f8a1c58345fc468553708d3cb508724aa081bd9"
5938+
integrity sha512-i9hvJpFYTT/qzB5xKWvDYaSXrIiNqi4ephi+5Lo6+DoQdwqPXQgmVVOZR+s3MBiHoFqsCZCX9TmVWG3HczmTEQ==
5939+
dependencies:
5940+
"@types/mime-db" "*"
5941+
5942+
"@types/hapi__shot@*":
5943+
version "4.1.4"
5944+
resolved "https://registry.yarnpkg.com/@types/hapi__shot/-/hapi__shot-4.1.4.tgz#17d418537bc180ac042361d9a331892a31a61583"
5945+
integrity sha512-AhEirOGy2ajtdV9WE/JqPkGeCH8lpgcSEQxn0ZNJkTvxkOv5DfZEXGit3l5J9P1VoQFAAHGNLVGWI5IWCiQf9A==
5946+
dependencies:
5947+
"@types/node" "*"
5948+
58185949
"@types/hast@^2.0.0":
58195950
version "2.3.6"
58205951
resolved "https://registry.yarnpkg.com/@types/hast/-/hast-2.3.6.tgz#bb8b05602112a26d22868acb70c4b20984ec7086"
@@ -5945,6 +6076,11 @@
59456076
dependencies:
59466077
"@types/unist" "*"
59476078

6079+
"@types/mime-db@*":
6080+
version "1.43.3"
6081+
resolved "https://registry.yarnpkg.com/@types/mime-db/-/mime-db-1.43.3.tgz#f7bec64a9a62ddded3371e82862c0516539710e8"
6082+
integrity sha512-vg0UsF1p1Qi/8iCARoie7F/Ng92zo7tQlL+sqE15GonkKVl55n/0vB6jSbrYTgDO0PSx9pKfGG1iZg9gJum3wA==
6083+
59486084
"@types/mime@^1":
59496085
version "1.3.2"
59506086
resolved "https://registry.yarnpkg.com/@types/mime/-/mime-1.3.2.tgz#93e25bf9ee75fe0fd80b594bc4feb0e862111b5a"
@@ -18717,6 +18853,17 @@ [email protected]:
1871718853
resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217"
1871818854
integrity sha1-o/Iiqarp+Wb10nx5ZRDigJF2Qhc=
1871918855

18856+
joi@^17.3.0:
18857+
version "17.11.0"
18858+
resolved "https://registry.yarnpkg.com/joi/-/joi-17.11.0.tgz#aa9da753578ec7720e6f0ca2c7046996ed04fc1a"
18859+
integrity sha512-NgB+lZLNoqISVy1rZocE9PZI36bL/77ie924Ri43yEvi9GUUMPeyVIr8KdFTMUlby1p0PBYMk9spIxEUQYqrJQ==
18860+
dependencies:
18861+
"@hapi/hoek" "^9.0.0"
18862+
"@hapi/topo" "^5.0.0"
18863+
"@sideway/address" "^4.1.3"
18864+
"@sideway/formula" "^3.0.1"
18865+
"@sideway/pinpoint" "^2.0.0"
18866+
1872018867
js-cleanup@^1.2.0:
1872118868
version "1.2.0"
1872218869
resolved "https://registry.yarnpkg.com/js-cleanup/-/js-cleanup-1.2.0.tgz#8dbc65954b1d38b255f1e8cf02cd17b3f7a053f9"

0 commit comments

Comments
 (0)