-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
feat(node): Always set up express, fastify, koa, hapi integrations #23473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fe3a7f9
feat(node): Always set up express, fastify, koa, hapi integrations
mydea 4c5fb70
feat(bun,deno): Add express, fastify, koa, hapi to default integrations
mydea 9beccc2
bump size limits
mydea 1a715f8
fix test
mydea ce3a301
test(deno): Add orchestrion-fastify integration test
mydea 5c6aafe
fix flake
mydea fd550a4
better comment
mydea feb3dee
streamline deno integration test sink
mydea f99b760
remove comment
mydea 7741e30
unify intergation getters into reusable functions
mydea d8d0ab1
always detect orchestrion
mydea 410aec1
no deprecate
mydea 5ec9fc2
fix deno integration test
mydea 6a8f866
add aws to tracing integrations
mydea 48af046
fix test
mydea 1e7e1fc
fix deno test
mydea c642d5a
fix bin test
mydea ee17f3d
fix test
mydea File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
dev-packages/deno-integration-tests/suites/orchestrion-fastify/test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| // <reference lib="deno.ns" /> | ||
|
|
||
| import { channel } from 'node:diagnostics_channel'; | ||
| import type { DenoClient } from '@sentry/deno'; | ||
| import { init } from '@sentry/deno'; | ||
| import { assert } from 'https://deno.land/std@0.212.0/assert/assert.ts'; | ||
| import { assertEquals } from 'https://deno.land/std@0.212.0/assert/assert_equals.ts'; | ||
| import { assertExists } from 'https://deno.land/std@0.212.0/assert/assert_exists.ts'; | ||
| import { errorSink, resetGlobals, withTimeout } from '../../src/index.ts'; | ||
|
|
||
| Deno.test('fastify instrumentation: included in default integrations (Deno 2.8.0+)', () => { | ||
| resetGlobals(); | ||
| const client = init({ traceLifecycle: 'static', dsn: 'https://username@domain/123' }) as DenoClient; | ||
| const names = client.getOptions().integrations.map(i => i.name); | ||
| assert(names.includes('Fastify'), `Fastify should be in defaults, got ${names.join(', ')}`); | ||
| }); | ||
|
|
||
| Deno.test('fastify instrumentation: tracing:fastify.request.handler:error channel captures the error', async () => { | ||
| resetGlobals(); | ||
| const sink = errorSink(); | ||
| init({ | ||
| traceLifecycle: 'static', | ||
| dsn: 'https://username@domain/123', | ||
| beforeSend: sink.beforeSend, | ||
| }); | ||
|
|
||
| const error = new Error('fastify boom'); | ||
|
|
||
| // Fastify v5 publishes this native diagnostics channel when a request handler errors; the | ||
| // integration subscribes to it directly (no orchestrion injection needed). A 5xx reply passes the | ||
| // default `shouldHandleError`, so the error is captured. | ||
| channel('tracing:fastify.request.handler:error').publish({ | ||
| error, | ||
| request: { method: 'GET', routeOptions: { url: '/boom' } }, | ||
| reply: { statusCode: 500 }, | ||
| }); | ||
|
|
||
| const event = await withTimeout( | ||
| sink.waitFor(e => e.exception?.values?.[0]?.value === 'fastify boom'), | ||
| 5000, | ||
| "the captured 'fastify boom' error", | ||
| ); | ||
|
|
||
| assertExists(event.exception?.values?.[0]); | ||
| assertEquals(event.exception?.values?.[0]?.mechanism?.type, 'auto.function.fastify'); | ||
| assertEquals(event.exception?.values?.[0]?.mechanism?.handled, false); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.