Skip to content

Commit fcc681b

Browse files
committed
refactor: detach nitro sdk from nuxt sdk
1 parent 03032ed commit fcc681b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+3872
-301
lines changed

dev-packages/e2e-tests/test-applications/nuxt-3/tests/cache.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ test.describe('Cache Instrumentation', () => {
2525

2626
// Test that we have cache operations from cachedFunction and cachedEventHandler
2727
const allCacheSpans = transaction.spans?.filter(
28-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.cache.nitro',
28+
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.cache.nuxt',
2929
);
3030
expect(allCacheSpans?.length).toBeGreaterThan(0);
3131

@@ -43,7 +43,7 @@ test.describe('Cache Instrumentation', () => {
4343
if (cacheMissSpan) {
4444
expect(cacheMissSpan.data).toMatchObject({
4545
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
46-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
46+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
4747
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: false,
4848
'db.operation.name': 'getItem',
4949
'db.collection.name': expect.stringMatching(/^(cache)?$/),
@@ -60,7 +60,7 @@ test.describe('Cache Instrumentation', () => {
6060
if (cacheHitSpan) {
6161
expect(cacheHitSpan.data).toMatchObject({
6262
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
63-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
63+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
6565
'db.operation.name': 'getItem',
6666
'db.collection.name': expect.stringMatching(/^(cache)?$/),
@@ -79,7 +79,7 @@ test.describe('Cache Instrumentation', () => {
7979
if (cacheSetSpan) {
8080
expect(cacheSetSpan.data).toMatchObject({
8181
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
82-
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
82+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
8383
'db.operation.name': 'setItem',
8484
'db.collection.name': expect.stringMatching(/^(cache)?$/),
8585
});
@@ -126,7 +126,7 @@ test.describe('Cache Instrumentation', () => {
126126

127127
// Get all cache-related spans
128128
const allCacheSpans = transaction1.spans?.filter(
129-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.cache.nitro',
129+
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN] === 'auto.cache.nuxt',
130130
);
131131

132132
// We should have cache operations

dev-packages/e2e-tests/test-applications/nuxt-3/tests/database-multi.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test.describe('multiple database instances', () => {
2121
expect(selectSpan).toBeDefined();
2222
expect(selectSpan?.op).toBe('db.query');
2323
expect(selectSpan?.data?.['db.system.name']).toBe('sqlite');
24-
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
24+
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
2525
});
2626

2727
test('instruments named database instance (users)', async ({ request }) => {
@@ -43,7 +43,7 @@ test.describe('multiple database instances', () => {
4343
expect(selectSpan).toBeDefined();
4444
expect(selectSpan?.op).toBe('db.query');
4545
expect(selectSpan?.data?.['db.system.name']).toBe('sqlite');
46-
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
46+
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
4747
});
4848

4949
test('instruments named database instance (analytics)', async ({ request }) => {
@@ -65,7 +65,7 @@ test.describe('multiple database instances', () => {
6565
expect(selectSpan).toBeDefined();
6666
expect(selectSpan?.op).toBe('db.query');
6767
expect(selectSpan?.data?.['db.system.name']).toBe('sqlite');
68-
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
68+
expect(selectSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
6969
});
7070

7171
test('instruments multiple database instances in single request', async ({ request }) => {
@@ -100,9 +100,9 @@ test.describe('multiple database instances', () => {
100100
expect(metricSpan?.data?.['db.system.name']).toBe('sqlite');
101101

102102
// All should have the same origin
103-
expect(sessionSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
104-
expect(accountSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
105-
expect(metricSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
103+
expect(sessionSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
104+
expect(accountSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
105+
expect(metricSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
106106
});
107107

108108
test('instruments SQL template tag across multiple databases', async ({ request }) => {
@@ -126,12 +126,12 @@ test.describe('multiple database instances', () => {
126126
expect(logsInsertSpan).toBeDefined();
127127
expect(logsInsertSpan?.op).toBe('db.query');
128128
expect(logsInsertSpan?.data?.['db.system.name']).toBe('sqlite');
129-
expect(logsInsertSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
129+
expect(logsInsertSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
130130

131131
expect(auditLogsInsertSpan).toBeDefined();
132132
expect(auditLogsInsertSpan?.op).toBe('db.query');
133133
expect(auditLogsInsertSpan?.data?.['db.system.name']).toBe('sqlite');
134-
expect(auditLogsInsertSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
134+
expect(auditLogsInsertSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
135135
});
136136

137137
test('creates correct span count for multiple database operations', async ({ request }) => {

dev-packages/e2e-tests/test-applications/nuxt-3/tests/database.test.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ test.describe('database integration', () => {
1818
expect(dbSpan?.description).toBe('SELECT * FROM users WHERE id = ?');
1919
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
2020
expect(dbSpan?.data?.['db.query.text']).toBe('SELECT * FROM users WHERE id = ?');
21-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
21+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
2222
});
2323

2424
test('captures db.prepare().all() span', async ({ request }) => {
@@ -39,7 +39,7 @@ test.describe('database integration', () => {
3939
expect(dbSpan?.description).toBe('SELECT * FROM products WHERE price > ?');
4040
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
4141
expect(dbSpan?.data?.['db.query.text']).toBe('SELECT * FROM products WHERE price > ?');
42-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
42+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
4343
});
4444

4545
test('captures db.prepare().run() span', async ({ request }) => {
@@ -60,7 +60,7 @@ test.describe('database integration', () => {
6060
expect(dbSpan?.description).toBe('INSERT INTO orders (customer, amount) VALUES (?, ?)');
6161
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
6262
expect(dbSpan?.data?.['db.query.text']).toBe('INSERT INTO orders (customer, amount) VALUES (?, ?)');
63-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
63+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
6464
});
6565

6666
test('captures db.prepare().bind().all() span', async ({ request }) => {
@@ -81,7 +81,7 @@ test.describe('database integration', () => {
8181
expect(dbSpan?.description).toBe('SELECT * FROM items WHERE category = ?');
8282
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
8383
expect(dbSpan?.data?.['db.query.text']).toBe('SELECT * FROM items WHERE category = ?');
84-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
84+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
8585
});
8686

8787
test('captures db.sql template tag span', async ({ request }) => {
@@ -102,7 +102,7 @@ test.describe('database integration', () => {
102102
expect(dbSpan?.description).toContain('INSERT INTO messages');
103103
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
104104
expect(dbSpan?.data?.['db.query.text']).toContain('INSERT INTO messages');
105-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
105+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
106106
});
107107

108108
test('captures db.exec() span', async ({ request }) => {
@@ -123,7 +123,7 @@ test.describe('database integration', () => {
123123
expect(dbSpan?.description).toBe(`INSERT INTO logs (message, level) VALUES ('Test log', 'INFO')`);
124124
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
125125
expect(dbSpan?.data?.['db.query.text']).toBe(`INSERT INTO logs (message, level) VALUES ('Test log', 'INFO')`);
126-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
126+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
127127
});
128128

129129
test('captures database error and marks span as failed', async ({ request }) => {
@@ -145,7 +145,7 @@ test.describe('database integration', () => {
145145
expect(error.exception?.values?.[0]?.value).toContain('no such table');
146146
expect(error.exception?.values?.[0]?.mechanism).toEqual({
147147
handled: false,
148-
type: 'auto.db.nitro',
148+
type: 'auto.db.nuxt',
149149
});
150150

151151
const dbSpan = transaction.spans?.find(
@@ -157,7 +157,7 @@ test.describe('database integration', () => {
157157
expect(dbSpan?.description).toBe('SELECT * FROM nonexistent_table WHERE invalid_column = ?');
158158
expect(dbSpan?.data?.['db.system.name']).toBe('sqlite');
159159
expect(dbSpan?.data?.['db.query.text']).toBe('SELECT * FROM nonexistent_table WHERE invalid_column = ?');
160-
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nitro');
160+
expect(dbSpan?.data?.['sentry.origin']).toBe('auto.db.nuxt');
161161
expect(dbSpan?.status).toBe('internal_error');
162162
});
163163

0 commit comments

Comments
 (0)