Skip to content

Commit 1e87c93

Browse files
author
Luca Forstner
authored
Merge branch 'develop' into onur/supabase-integration
2 parents f081a5d + 55cb92c commit 1e87c93

File tree

28 files changed

+858
-133
lines changed

28 files changed

+858
-133
lines changed

.github/ISSUE_TEMPLATE/bug.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,17 @@ body:
3232
options:
3333
- '@sentry/browser'
3434
- '@sentry/node'
35+
- '@sentry/node - express'
36+
- '@sentry/node - fastify'
37+
- '@sentry/node - koa'
38+
- '@sentry/node - hapi'
39+
- '@sentry/node - connect'
3540
- '@sentry/angular'
3641
- '@sentry/astro'
3742
- '@sentry/aws-serverless'
3843
- '@sentry/bun'
3944
- '@sentry/cloudflare'
45+
- '@sentry/cloudflare - hono'
4046
- '@sentry/deno'
4147
- '@sentry/ember'
4248
- '@sentry/gatsby'
@@ -45,6 +51,7 @@ body:
4551
- '@sentry/nextjs'
4652
- '@sentry/nuxt'
4753
- '@sentry/react'
54+
- '@sentry/react-router'
4855
- '@sentry/remix'
4956
- '@sentry/solid'
5057
- '@sentry/solidstart'

.github/workflows/issue-package-label.yml

Lines changed: 49 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -30,76 +30,100 @@ jobs:
3030
map: |
3131
{
3232
"@sentry.angular": {
33-
"label": "Package: angular"
33+
"label": "Angular"
3434
},
3535
"@sentry.astro": {
36-
"label": "Package: astro"
36+
"label": "Astro"
3737
},
3838
"@sentry.aws-serverless": {
39-
"label": "Package: aws-serverless"
39+
"label": "AWS Lambda"
4040
},
4141
"@sentry.browser": {
42-
"label": "Package: browser"
42+
"label": "Browser"
4343
},
4444
"@sentry.bun": {
45-
"label": "Package: bun"
45+
"label": "Bun"
46+
},
47+
"@sentry.cloudflare - hono": {
48+
"label": "Hono"
4649
},
4750
"@sentry.cloudflare": {
48-
"label": "Package: cloudflare"
51+
"label": "Cloudflare Workers"
4952
},
5053
"@sentry.deno": {
51-
"label": "Package: deno"
54+
"label": "Deno"
5255
},
5356
"@sentry.ember": {
54-
"label": "Package: ember"
57+
"label": "Ember"
5558
},
5659
"@sentry.gatsby": {
57-
"label": "Package: gatbsy"
60+
"label": "Gatbsy"
5861
},
5962
"@sentry.google-cloud-serverless": {
60-
"label": "Package: google-cloud-serverless"
63+
"label": "Google Cloud Functions"
6164
},
6265
"@sentry.nestjs": {
63-
"label": "Package: nestjs"
66+
"label": "Nest.js"
6467
},
6568
"@sentry.nextjs": {
66-
"label": "Package: nextjs"
69+
"label": "Next.js"
70+
},
71+
"@sentry.node - express": {
72+
"label": "Express"
73+
},
74+
"@sentry.node - fastify": {
75+
"label": "Fastify"
76+
},
77+
"@sentry.node - koa": {
78+
"label": "Koa"
79+
},
80+
"@sentry.node - hapi": {
81+
"label": "Hapi
82+
},
83+
"@sentry.node - connect": {
84+
"label": "Connect
6785
},
6886
"@sentry.node": {
69-
"label": "Package: node"
87+
"label": "Node.js"
7088
},
7189
"@sentry.nuxt": {
72-
"label": "Package: nuxt"
90+
"label": "Nuxt"
91+
},
92+
"@sentry.react-router": {
93+
"label": "React Router Framework "
7394
},
7495
"@sentry.react": {
75-
"label": "Package: react"
96+
"label": "React"
7697
},
7798
"@sentry.remix": {
78-
"label": "Package: remix"
99+
"label": "Remix"
79100
},
80101
"@sentry.solid": {
81-
"label": "Package: solid"
102+
"label": "Solid"
82103
},
83-
"@sentry.solid": {
84-
"label": "Package: solidstart"
104+
"@sentry.solidstart": {
105+
"label": "SolidStart"
85106
},
86107
"@sentry.sveltekit": {
87-
"label": "Package: sveltekit"
108+
"label": "SvelteKit"
88109
},
89110
"@sentry.svelte": {
90-
"label": "Package: svelte"
111+
"label": "Svelte"
91112
},
92113
"@sentry.vue": {
93-
"label": "Package: vue"
114+
"label": "Vue"
115+
},
116+
"@sentry.tanstackstart-react": {
117+
"label": "Tanstack Start React"
94118
},
95119
"@sentry.wasm": {
96-
"label": "Package: wasm"
120+
"label": "WASM"
97121
},
98122
"Sentry.Browser.Loader": {
99-
"label": "Package-Meta: Loader"
123+
"label": "Browser\nLoader Script"
100124
},
101125
"Sentry.Browser.CDN.bundle": {
102-
"label": "Package-Meta: CDN"
126+
"label": "Browser\nCDN Bundle"
103127
}
104128
}
105129
export_to: output

dev-packages/node-integration-tests/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"dependencies": {
2828
"@aws-sdk/client-s3": "^3.552.0",
2929
"@hapi/hapi": "^21.3.10",
30-
"@nestjs/common": "10.4.6",
30+
"@nestjs/common": "11.0.16",
3131
"@nestjs/core": "10.4.6",
3232
"@nestjs/platform-express": "10.4.6",
3333
"@sentry/aws-serverless": "9.12.0",
@@ -37,7 +37,7 @@
3737
"@types/mysql": "^2.15.21",
3838
"@types/pg": "^8.6.5",
3939
"ai": "^4.0.6",
40-
"amqplib": "^0.10.4",
40+
"amqplib": "^0.10.7",
4141
"apollo-server": "^3.11.1",
4242
"axios": "^1.7.7",
4343
"body-parser": "^1.20.3",
@@ -67,6 +67,7 @@
6767
"reflect-metadata": "0.2.1",
6868
"rxjs": "^7.8.1",
6969
"tedious": "^18.6.1",
70+
"winston": "^3.17.0",
7071
"yargs": "^16.2.0"
7172
},
7273
"devDependencies": {
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const { ApolloServer, gql } = require('apollo-server');
2+
const Sentry = require('@sentry/aws-serverless');
3+
4+
module.exports = () => {
5+
return Sentry.startSpan({ name: 'Test Server Start' }, () => {
6+
return new ApolloServer({
7+
typeDefs: gql`
8+
type Query {
9+
hello: String
10+
world: String
11+
}
12+
type Mutation {
13+
login(email: String): String
14+
}
15+
`,
16+
resolvers: {
17+
Query: {
18+
hello: () => {
19+
return 'Hello!';
20+
},
21+
world: () => {
22+
return 'World!';
23+
},
24+
},
25+
Mutation: {
26+
login: async (_, { email }) => {
27+
return `${email}--token`;
28+
},
29+
},
30+
},
31+
introspection: false,
32+
debug: false,
33+
});
34+
});
35+
};
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
const { loggingTransport } = require('@sentry-internal/node-integration-tests');
2+
const Sentry = require('@sentry/aws-serverless');
3+
4+
Sentry.init({
5+
dsn: 'https://[email protected]/1337',
6+
tracesSampleRate: 1.0,
7+
integrations: [Sentry.graphqlIntegration({ useOperationNameForRootSpan: true })],
8+
transport: loggingTransport,
9+
});
10+
11+
async function run() {
12+
const apolloServer = require('./apollo-server')();
13+
14+
await Sentry.startSpan({ name: 'Test Transaction' }, async span => {
15+
// Ref: https://www.apollographql.com/docs/apollo-server/testing/testing/#testing-using-executeoperation
16+
await apolloServer.executeOperation({
17+
query: 'query GetHello {hello}',
18+
});
19+
20+
setTimeout(() => {
21+
span.end();
22+
apolloServer.stop();
23+
}, 500);
24+
});
25+
}
26+
27+
run();
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { afterAll, describe, expect, test } from 'vitest';
2+
import { cleanupChildProcesses, createRunner } from '../../../../utils/runner';
3+
4+
const EXPECTED_TRANSCATION = {
5+
transaction: 'Test Transaction (query GetHello)',
6+
spans: expect.arrayContaining([
7+
expect.objectContaining({
8+
description: 'query GetHello',
9+
origin: 'auto.graphql.otel.graphql',
10+
status: 'ok',
11+
}),
12+
]),
13+
};
14+
15+
describe('graphqlIntegration', () => {
16+
afterAll(() => {
17+
cleanupChildProcesses();
18+
});
19+
20+
test('should use GraphQL operation name for root span if useOperationNameForRootSpan is set', async () => {
21+
await createRunner(__dirname, 'scenario.js')
22+
.ignore('event')
23+
.expect({ transaction: { transaction: 'Test Server Start (query IntrospectionQuery)' } })
24+
.expect({ transaction: EXPECTED_TRANSCATION })
25+
.start()
26+
.completed();
27+
});
28+
});

dev-packages/node-integration-tests/suites/tracing/apollo-graphql/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import { createRunner } from '../../../utils/runner';
33

44
// Graphql Instrumentation emits some spans by default on server start
55
const EXPECTED_START_SERVER_TRANSACTION = {
6-
transaction: 'Test Server Start',
6+
transaction: 'Test Server Start (query IntrospectionQuery)',
77
};
88

99
describe('GraphQL/Apollo Tests', () => {
1010
test('should instrument GraphQL queries used from Apollo Server.', async () => {
1111
const EXPECTED_TRANSACTION = {
12-
transaction: 'Test Transaction',
12+
transaction: 'Test Transaction (query)',
1313
spans: expect.arrayContaining([
1414
expect.objectContaining({
1515
data: {
@@ -33,7 +33,7 @@ describe('GraphQL/Apollo Tests', () => {
3333

3434
test('should instrument GraphQL mutations used from Apollo Server.', async () => {
3535
const EXPECTED_TRANSACTION = {
36-
transaction: 'Test Transaction',
36+
transaction: 'Test Transaction (mutation Mutation)',
3737
spans: expect.arrayContaining([
3838
expect.objectContaining({
3939
data: {

dev-packages/node-integration-tests/suites/tracing/apollo-graphql/useOperationNameForRootSpan/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { createRunner } from '../../../../utils/runner';
2-
import { describe, test, expect } from 'vitest'
2+
import { describe, test, expect } from 'vitest';
33

44
// Graphql Instrumentation emits some spans by default on server start
55
const EXPECTED_START_SERVER_TRANSACTION = {
6-
transaction: 'Test Server Start',
6+
transaction: 'Test Server Start (query IntrospectionQuery)',
77
};
88

99
describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
@@ -61,7 +61,7 @@ describe('GraphQL/Apollo Tests > useOperationNameForRootSpan', () => {
6161

6262
test('useOperationNameForRootSpan ignores an invalid root span', async () => {
6363
const EXPECTED_TRANSACTION = {
64-
transaction: 'test span name',
64+
transaction: 'test span name (query GetHello)',
6565
spans: expect.arrayContaining([
6666
expect.objectContaining({
6767
data: {
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
import * as Sentry from '@sentry/node';
2+
import winston from 'winston';
3+
import Transport from 'winston-transport';
4+
import { loggingTransport } from '@sentry-internal/node-integration-tests';
5+
6+
Sentry.init({
7+
dsn: 'https://[email protected]/1337',
8+
release: '1.0.0',
9+
environment: 'test',
10+
_experiments: {
11+
enableLogs: true,
12+
},
13+
transport: loggingTransport,
14+
});
15+
16+
async function run(): Promise<void> {
17+
// Create a custom transport that extends winston-transport
18+
const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport);
19+
20+
// Create logger with default levels
21+
const logger = winston.createLogger({
22+
transports: [new SentryWinstonTransport()],
23+
});
24+
25+
// Test basic logging
26+
logger.info('Test info message');
27+
logger.error('Test error message');
28+
29+
// If custom levels are requested
30+
if (process.env.CUSTOM_LEVELS === 'true') {
31+
const customLevels = {
32+
levels: {
33+
error: 0,
34+
warn: 1,
35+
info: 2,
36+
http: 3,
37+
verbose: 4,
38+
debug: 5,
39+
silly: 6,
40+
},
41+
colors: {
42+
error: 'red',
43+
warn: 'yellow',
44+
info: 'green',
45+
http: 'magenta',
46+
verbose: 'cyan',
47+
debug: 'blue',
48+
silly: 'grey',
49+
},
50+
};
51+
52+
const customLogger = winston.createLogger({
53+
levels: customLevels.levels,
54+
transports: [new SentryWinstonTransport()],
55+
});
56+
57+
customLogger.info('Test info message');
58+
customLogger.error('Test error message');
59+
}
60+
61+
// If metadata is requested
62+
if (process.env.WITH_METADATA === 'true') {
63+
logger.info('Test message with metadata', {
64+
foo: 'bar',
65+
number: 42,
66+
});
67+
}
68+
69+
await Sentry.flush();
70+
}
71+
72+
// eslint-disable-next-line @typescript-eslint/no-floating-promises
73+
void run();

0 commit comments

Comments
 (0)