Skip to content

Commit 57a4e4e

Browse files
msonnbclaude
andauthored
feat(nuxt, nitro)!: Use convention cache ops for storage spans (#22689)
Collapse the ten per-method storage ops onto the three convention cache ops: | unstorage method | op | | --- | --- | | `hasItem`, `getItem`, `getItemRaw`, `getItems`, `getKeys` | `cache.get` | | `setItem`, `setItemRaw`, `setItems` | `cache.put` | | `removeItem`, `clear` | `cache.remove` | `db.operation.name` already carried the exact method, so no detail is lost. The E2E tests located spans with a `findSpansByOp` helper, which no longer identifies a single operation. They now use `findSpansByMethod`, keyed on `db.operation.name`. Part of #22446 --------- Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent b8916d7 commit 57a4e4e

16 files changed

Lines changed: 241 additions & 186 deletions

File tree

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ test.describe('Cache Instrumentation', () => {
1818

1919
const transaction = await transactionPromise;
2020

21-
const findSpansByOp = (op: string) => {
22-
return transaction.spans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === op) || [];
21+
const findSpansByMethod = (method: string) => {
22+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2323
};
2424

2525
const allCacheSpans = transaction.spans?.filter(
@@ -28,7 +28,7 @@ test.describe('Cache Instrumentation', () => {
2828
expect(allCacheSpans?.length).toBeGreaterThan(0);
2929

3030
// getItem spans for cachedFunction - should have both cache miss and cache hit
31-
const getItemSpans = findSpansByOp('cache.get_item');
31+
const getItemSpans = findSpansByMethod('getItem');
3232
expect(getItemSpans.length).toBeGreaterThan(0);
3333

3434
// Find cache miss (first call to getCachedUser('123'))
@@ -40,7 +40,7 @@ test.describe('Cache Instrumentation', () => {
4040
);
4141
expect(cacheMissSpan).toBeDefined();
4242
expect(cacheMissSpan?.data).toMatchObject({
43-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
43+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4444
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4545
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: false,
4646
'db.operation.name': 'getItem',
@@ -55,14 +55,14 @@ test.describe('Cache Instrumentation', () => {
5555
);
5656
expect(cacheHitSpan).toBeDefined();
5757
expect(cacheHitSpan?.data).toMatchObject({
58-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
58+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
5959
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6060
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
6161
'db.operation.name': 'getItem',
6262
});
6363

6464
// setItem spans for cachedFunction - when cache miss occurs, value is set
65-
const setItemSpans = findSpansByOp('cache.set_item');
65+
const setItemSpans = findSpansByMethod('setItem');
6666
expect(setItemSpans.length).toBeGreaterThan(0);
6767

6868
const cacheSetSpan = setItemSpans.find(
@@ -72,7 +72,7 @@ test.describe('Cache Instrumentation', () => {
7272
);
7373
expect(cacheSetSpan).toBeDefined();
7474
expect(cacheSetSpan?.data).toMatchObject({
75-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
75+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
7676
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7777
'db.operation.name': 'setItem',
7878
});
@@ -120,12 +120,8 @@ test.describe('Cache Instrumentation', () => {
120120
);
121121
expect(allCacheSpans?.length).toBeGreaterThan(0);
122122

123-
const allGetItemSpans = allCacheSpans?.filter(
124-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.get_item',
125-
);
126-
const allSetItemSpans = allCacheSpans?.filter(
127-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.set_item',
128-
);
123+
const allGetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.get');
124+
const allSetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.put');
129125

130126
expect(allGetItemSpans?.length).toBeGreaterThan(0);
131127
expect(allSetItemSpans?.length).toBeGreaterThan(0);

dev-packages/e2e-tests/test-applications/nitro-3/tests/storage-aliases.test.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ test.describe('Storage Instrumentation - Aliases', () => {
1818
const transaction = await transactionPromise;
1919

2020
// Helper to find spans by operation
21-
const findSpansByOp = (op: string) => {
22-
return transaction.spans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === op) || [];
21+
const findSpansByMethod = (method: string) => {
22+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2323
};
2424

2525
// Test set (alias for setItem)
26-
const setSpans = findSpansByOp('cache.set_item');
26+
const setSpans = findSpansByMethod('setItem');
2727
expect(setSpans.length).toBeGreaterThanOrEqual(1);
2828
const setSpan = setSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
2929
expect(setSpan).toBeDefined();
3030
expect(setSpan?.data).toMatchObject({
31-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
31+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
3434
'db.operation.name': 'setItem',
@@ -37,12 +37,12 @@ test.describe('Storage Instrumentation - Aliases', () => {
3737
expect(setSpan?.description).toBe(prefixKey('alias:user'));
3838

3939
// Test get (alias for getItem)
40-
const getSpans = findSpansByOp('cache.get_item');
40+
const getSpans = findSpansByMethod('getItem');
4141
expect(getSpans.length).toBeGreaterThanOrEqual(1);
4242
const getSpan = getSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
4343
expect(getSpan).toBeDefined();
4444
expect(getSpan?.data).toMatchObject({
45-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
45+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4646
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4747
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
4848
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -52,12 +52,12 @@ test.describe('Storage Instrumentation - Aliases', () => {
5252
expect(getSpan?.description).toBe(prefixKey('alias:user'));
5353

5454
// Test has (alias for hasItem)
55-
const hasSpans = findSpansByOp('cache.has_item');
55+
const hasSpans = findSpansByMethod('hasItem');
5656
expect(hasSpans.length).toBeGreaterThanOrEqual(1);
5757
const hasSpan = hasSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
5858
expect(hasSpan).toBeDefined();
5959
expect(hasSpan?.data).toMatchObject({
60-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.has_item',
60+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6161
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6262
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
6363
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -66,13 +66,13 @@ test.describe('Storage Instrumentation - Aliases', () => {
6666
});
6767

6868
// Test del and remove (both aliases for removeItem)
69-
const removeSpans = findSpansByOp('cache.remove_item');
69+
const removeSpans = findSpansByMethod('removeItem');
7070
expect(removeSpans.length).toBeGreaterThanOrEqual(2);
7171

7272
const delSpan = removeSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:temp1'));
7373
expect(delSpan).toBeDefined();
7474
expect(delSpan?.data).toMatchObject({
75-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
75+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
7676
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7777
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp1'),
7878
'db.operation.name': 'removeItem',
@@ -83,7 +83,7 @@ test.describe('Storage Instrumentation - Aliases', () => {
8383
const removeSpan = removeSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:temp2'));
8484
expect(removeSpan).toBeDefined();
8585
expect(removeSpan?.data).toMatchObject({
86-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
86+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
8787
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
8888
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp2'),
8989
'db.operation.name': 'removeItem',

dev-packages/e2e-tests/test-applications/nitro-3/tests/storage.test.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,17 @@ test.describe('Storage Instrumentation', () => {
1818
const transaction = await transactionPromise;
1919

2020
// Helper to find spans by operation
21-
const findSpansByOp = (op: string) => {
22-
return transaction.spans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === op) || [];
21+
const findSpansByMethod = (method: string) => {
22+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2323
};
2424

2525
// Test setItem spans
26-
const setItemSpans = findSpansByOp('cache.set_item');
26+
const setItemSpans = findSpansByMethod('setItem');
2727
expect(setItemSpans.length).toBeGreaterThanOrEqual(1);
2828
const setItemSpan = setItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
2929
expect(setItemSpan).toBeDefined();
3030
expect(setItemSpan?.data).toMatchObject({
31-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
31+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
3232
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
3333
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
3434
'db.operation.name': 'setItem',
@@ -37,27 +37,27 @@ test.describe('Storage Instrumentation', () => {
3737
expect(setItemSpan?.description).toBe(prefixKey('user:123'));
3838

3939
// Test setItemRaw spans
40-
const setItemRawSpans = findSpansByOp('cache.set_item_raw');
40+
const setItemRawSpans = findSpansByMethod('setItemRaw');
4141
expect(setItemRawSpans.length).toBeGreaterThanOrEqual(1);
4242
const setItemRawSpan = setItemRawSpans.find(
4343
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('raw:data'),
4444
);
4545
expect(setItemRawSpan).toBeDefined();
4646
expect(setItemRawSpan?.data).toMatchObject({
47-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item_raw',
47+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
4848
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4949
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
5050
'db.operation.name': 'setItemRaw',
5151
'db.system.name': expect.any(String),
5252
});
5353

5454
// Test hasItem spans - should have cache hit attribute
55-
const hasItemSpans = findSpansByOp('cache.has_item');
55+
const hasItemSpans = findSpansByMethod('hasItem');
5656
expect(hasItemSpans.length).toBeGreaterThanOrEqual(1);
5757
const hasItemSpan = hasItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
5858
expect(hasItemSpan).toBeDefined();
5959
expect(hasItemSpan?.data).toMatchObject({
60-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.has_item',
60+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6161
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6262
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
6363
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -66,12 +66,12 @@ test.describe('Storage Instrumentation', () => {
6666
});
6767

6868
// Test getItem spans - should have cache hit attribute
69-
const getItemSpans = findSpansByOp('cache.get_item');
69+
const getItemSpans = findSpansByMethod('getItem');
7070
expect(getItemSpans.length).toBeGreaterThanOrEqual(1);
7171
const getItemSpan = getItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
7272
expect(getItemSpan).toBeDefined();
7373
expect(getItemSpan?.data).toMatchObject({
74-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
74+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
7575
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7676
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
7777
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -81,14 +81,14 @@ test.describe('Storage Instrumentation', () => {
8181
expect(getItemSpan?.description).toBe(prefixKey('user:123'));
8282

8383
// Test getItemRaw spans - should have cache hit attribute
84-
const getItemRawSpans = findSpansByOp('cache.get_item_raw');
84+
const getItemRawSpans = findSpansByMethod('getItemRaw');
8585
expect(getItemRawSpans.length).toBeGreaterThanOrEqual(1);
8686
const getItemRawSpan = getItemRawSpans.find(
8787
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('raw:data'),
8888
);
8989
expect(getItemRawSpan).toBeDefined();
9090
expect(getItemRawSpan?.data).toMatchObject({
91-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item_raw',
91+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
9292
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
9393
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
9494
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -97,35 +97,35 @@ test.describe('Storage Instrumentation', () => {
9797
});
9898

9999
// Test getKeys spans
100-
const getKeysSpans = findSpansByOp('cache.get_keys');
100+
const getKeysSpans = findSpansByMethod('getKeys');
101101
expect(getKeysSpans.length).toBeGreaterThanOrEqual(1);
102102
expect(getKeysSpans[0]?.data).toMatchObject({
103-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_keys',
103+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
104104
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
105105
'db.operation.name': 'getKeys',
106106
'db.system.name': expect.any(String),
107107
});
108108

109109
// Test removeItem spans
110-
const removeItemSpans = findSpansByOp('cache.remove_item');
110+
const removeItemSpans = findSpansByMethod('removeItem');
111111
expect(removeItemSpans.length).toBeGreaterThanOrEqual(1);
112112
const removeItemSpan = removeItemSpans.find(
113113
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('batch:1'),
114114
);
115115
expect(removeItemSpan).toBeDefined();
116116
expect(removeItemSpan?.data).toMatchObject({
117-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
117+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
118118
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
119119
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('batch:1'),
120120
'db.operation.name': 'removeItem',
121121
'db.system.name': expect.any(String),
122122
});
123123

124124
// Test clear spans
125-
const clearSpans = findSpansByOp('cache.clear');
125+
const clearSpans = findSpansByMethod('clear');
126126
expect(clearSpans.length).toBeGreaterThanOrEqual(1);
127127
expect(clearSpans[0]?.data).toMatchObject({
128-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.clear',
128+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
129129
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
130130
'db.operation.name': 'clear',
131131
'db.system.name': expect.any(String),

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

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ test.describe('Cache Instrumentation', () => {
1919
const transaction = await transactionPromise;
2020

2121
// Helper to find spans by operation
22-
const findSpansByOp = (op: string) => {
23-
return transaction.spans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === op) || [];
22+
const findSpansByMethod = (method: string) => {
23+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2424
};
2525

2626
// Test that we have cache operations from cachedFunction and cachedEventHandler
@@ -30,7 +30,7 @@ test.describe('Cache Instrumentation', () => {
3030
expect(allCacheSpans?.length).toBeGreaterThan(0);
3131

3232
// Test getItem spans for cachedFunction - should have both cache miss and cache hit
33-
const getItemSpans = findSpansByOp('cache.get_item');
33+
const getItemSpans = findSpansByMethod('getItem');
3434
expect(getItemSpans.length).toBeGreaterThan(0);
3535

3636
// Find cache miss (first call to getCachedUser('123'))
@@ -42,7 +42,7 @@ test.describe('Cache Instrumentation', () => {
4242
);
4343
if (cacheMissSpan) {
4444
expect(cacheMissSpan.data).toMatchObject({
45-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
45+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4646
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
4747
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: false,
4848
'db.operation.name': 'getItem',
@@ -59,7 +59,7 @@ test.describe('Cache Instrumentation', () => {
5959
);
6060
if (cacheHitSpan) {
6161
expect(cacheHitSpan.data).toMatchObject({
62-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
62+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6363
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6464
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
6565
'db.operation.name': 'getItem',
@@ -68,7 +68,7 @@ test.describe('Cache Instrumentation', () => {
6868
}
6969

7070
// Test setItem spans for cachedFunction - when cache miss occurs, value is set
71-
const setItemSpans = findSpansByOp('cache.set_item');
71+
const setItemSpans = findSpansByMethod('setItem');
7272
expect(setItemSpans.length).toBeGreaterThan(0);
7373

7474
const cacheSetSpan = setItemSpans.find(
@@ -78,7 +78,7 @@ test.describe('Cache Instrumentation', () => {
7878
);
7979
if (cacheSetSpan) {
8080
expect(cacheSetSpan.data).toMatchObject({
81-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
81+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
8282
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
8383
'db.operation.name': 'setItem',
8484
'db.collection.name': expect.stringMatching(/^(cache)?$/),
@@ -133,14 +133,10 @@ test.describe('Cache Instrumentation', () => {
133133
expect(allCacheSpans?.length).toBeGreaterThan(0);
134134

135135
// Get all getItem operations
136-
const allGetItemSpans = allCacheSpans?.filter(
137-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.get_item',
138-
);
136+
const allGetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.get');
139137

140138
// Get all setItem operations
141-
const allSetItemSpans = allCacheSpans?.filter(
142-
span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.set_item',
143-
);
139+
const allSetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.put');
144140

145141
// We should have both get and set operations
146142
expect(allGetItemSpans?.length).toBeGreaterThan(0);

0 commit comments

Comments
 (0)