Skip to content

Commit 15c4dbe

Browse files
msonnbclaude
andcommitted
feat(nuxt, nitro)!: Use convention cache ops for storage spans
Collapse the per-method ops onto `cache.get` / `cache.put` / `cache.remove`. The exact unstorage method is already preserved in `db.operation.name`. Ref: JS-3105 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent c6e3775 commit 15c4dbe

16 files changed

Lines changed: 226 additions & 181 deletions

File tree

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ 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+
// Several unstorage methods share one convention op (e.g. hasItem/getItem/getKeys are all
22+
// `cache.get`), so spans are located by `db.operation.name`, which stays unique per method.
23+
const findSpansByMethod = (method: string) => {
24+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2325
};
2426

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

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

3436
// Find cache miss (first call to getCachedUser('123'))
@@ -40,7 +42,7 @@ test.describe('Cache Instrumentation', () => {
4042
);
4143
expect(cacheMissSpan).toBeDefined();
4244
expect(cacheMissSpan?.data).toMatchObject({
43-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
45+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4446
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4547
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: false,
4648
'db.operation.name': 'getItem',
@@ -55,14 +57,14 @@ test.describe('Cache Instrumentation', () => {
5557
);
5658
expect(cacheHitSpan).toBeDefined();
5759
expect(cacheHitSpan?.data).toMatchObject({
58-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
60+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
5961
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6062
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
6163
'db.operation.name': 'getItem',
6264
});
6365

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

6870
const cacheSetSpan = setItemSpans.find(
@@ -72,7 +74,7 @@ test.describe('Cache Instrumentation', () => {
7274
);
7375
expect(cacheSetSpan).toBeDefined();
7476
expect(cacheSetSpan?.data).toMatchObject({
75-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
77+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
7678
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7779
'db.operation.name': 'setItem',
7880
});
@@ -120,12 +122,8 @@ test.describe('Cache Instrumentation', () => {
120122
);
121123
expect(allCacheSpans?.length).toBeGreaterThan(0);
122124

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-
);
125+
const allGetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.get');
126+
const allSetItemSpans = allCacheSpans?.filter(span => span.data?.[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'cache.put');
129127

130128
expect(allGetItemSpans?.length).toBeGreaterThan(0);
131129
expect(allSetItemSpans?.length).toBeGreaterThan(0);

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ 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+
// Several unstorage methods share one convention op (e.g. hasItem/getItem/getKeys are all
22+
// `cache.get`), so spans are located by `db.operation.name`, which stays unique per method.
23+
const findSpansByMethod = (method: string) => {
24+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2325
};
2426

2527
// Test set (alias for setItem)
26-
const setSpans = findSpansByOp('cache.set_item');
28+
const setSpans = findSpansByMethod('setItem');
2729
expect(setSpans.length).toBeGreaterThanOrEqual(1);
2830
const setSpan = setSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
2931
expect(setSpan).toBeDefined();
3032
expect(setSpan?.data).toMatchObject({
31-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
33+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
3234
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
3335
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
3436
'db.operation.name': 'setItem',
@@ -37,12 +39,12 @@ test.describe('Storage Instrumentation - Aliases', () => {
3739
expect(setSpan?.description).toBe(prefixKey('alias:user'));
3840

3941
// Test get (alias for getItem)
40-
const getSpans = findSpansByOp('cache.get_item');
42+
const getSpans = findSpansByMethod('getItem');
4143
expect(getSpans.length).toBeGreaterThanOrEqual(1);
4244
const getSpan = getSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
4345
expect(getSpan).toBeDefined();
4446
expect(getSpan?.data).toMatchObject({
45-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
47+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4648
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4749
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
4850
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -52,12 +54,12 @@ test.describe('Storage Instrumentation - Aliases', () => {
5254
expect(getSpan?.description).toBe(prefixKey('alias:user'));
5355

5456
// Test has (alias for hasItem)
55-
const hasSpans = findSpansByOp('cache.has_item');
57+
const hasSpans = findSpansByMethod('hasItem');
5658
expect(hasSpans.length).toBeGreaterThanOrEqual(1);
5759
const hasSpan = hasSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:user'));
5860
expect(hasSpan).toBeDefined();
5961
expect(hasSpan?.data).toMatchObject({
60-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.has_item',
62+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6163
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6264
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:user'),
6365
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -66,13 +68,13 @@ test.describe('Storage Instrumentation - Aliases', () => {
6668
});
6769

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

7274
const delSpan = removeSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:temp1'));
7375
expect(delSpan).toBeDefined();
7476
expect(delSpan?.data).toMatchObject({
75-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
77+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
7678
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7779
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp1'),
7880
'db.operation.name': 'removeItem',
@@ -83,7 +85,7 @@ test.describe('Storage Instrumentation - Aliases', () => {
8385
const removeSpan = removeSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('alias:temp2'));
8486
expect(removeSpan).toBeDefined();
8587
expect(removeSpan?.data).toMatchObject({
86-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
88+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
8789
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
8890
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('alias:temp2'),
8991
'db.operation.name': 'removeItem',

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

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,17 +18,19 @@ 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+
// Several unstorage methods share one convention op (e.g. hasItem/getItem/getKeys are all
22+
// `cache.get`), so spans are located by `db.operation.name`, which stays unique per method.
23+
const findSpansByMethod = (method: string) => {
24+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2325
};
2426

2527
// Test setItem spans
26-
const setItemSpans = findSpansByOp('cache.set_item');
28+
const setItemSpans = findSpansByMethod('setItem');
2729
expect(setItemSpans.length).toBeGreaterThanOrEqual(1);
2830
const setItemSpan = setItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
2931
expect(setItemSpan).toBeDefined();
3032
expect(setItemSpan?.data).toMatchObject({
31-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
33+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
3234
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
3335
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
3436
'db.operation.name': 'setItem',
@@ -37,27 +39,27 @@ test.describe('Storage Instrumentation', () => {
3739
expect(setItemSpan?.description).toBe(prefixKey('user:123'));
3840

3941
// Test setItemRaw spans
40-
const setItemRawSpans = findSpansByOp('cache.set_item_raw');
42+
const setItemRawSpans = findSpansByMethod('setItemRaw');
4143
expect(setItemRawSpans.length).toBeGreaterThanOrEqual(1);
4244
const setItemRawSpan = setItemRawSpans.find(
4345
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('raw:data'),
4446
);
4547
expect(setItemRawSpan).toBeDefined();
4648
expect(setItemRawSpan?.data).toMatchObject({
47-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item_raw',
49+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
4850
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
4951
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
5052
'db.operation.name': 'setItemRaw',
5153
'db.system.name': expect.any(String),
5254
});
5355

5456
// Test hasItem spans - should have cache hit attribute
55-
const hasItemSpans = findSpansByOp('cache.has_item');
57+
const hasItemSpans = findSpansByMethod('hasItem');
5658
expect(hasItemSpans.length).toBeGreaterThanOrEqual(1);
5759
const hasItemSpan = hasItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
5860
expect(hasItemSpan).toBeDefined();
5961
expect(hasItemSpan?.data).toMatchObject({
60-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.has_item',
62+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6163
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
6264
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
6365
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -66,12 +68,12 @@ test.describe('Storage Instrumentation', () => {
6668
});
6769

6870
// Test getItem spans - should have cache hit attribute
69-
const getItemSpans = findSpansByOp('cache.get_item');
71+
const getItemSpans = findSpansByMethod('getItem');
7072
expect(getItemSpans.length).toBeGreaterThanOrEqual(1);
7173
const getItemSpan = getItemSpans.find(span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('user:123'));
7274
expect(getItemSpan).toBeDefined();
7375
expect(getItemSpan?.data).toMatchObject({
74-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
76+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
7577
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
7678
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('user:123'),
7779
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -81,14 +83,14 @@ test.describe('Storage Instrumentation', () => {
8183
expect(getItemSpan?.description).toBe(prefixKey('user:123'));
8284

8385
// Test getItemRaw spans - should have cache hit attribute
84-
const getItemRawSpans = findSpansByOp('cache.get_item_raw');
86+
const getItemRawSpans = findSpansByMethod('getItemRaw');
8587
expect(getItemRawSpans.length).toBeGreaterThanOrEqual(1);
8688
const getItemRawSpan = getItemRawSpans.find(
8789
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('raw:data'),
8890
);
8991
expect(getItemRawSpan).toBeDefined();
9092
expect(getItemRawSpan?.data).toMatchObject({
91-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item_raw',
93+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
9294
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
9395
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('raw:data'),
9496
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
@@ -97,35 +99,35 @@ test.describe('Storage Instrumentation', () => {
9799
});
98100

99101
// Test getKeys spans
100-
const getKeysSpans = findSpansByOp('cache.get_keys');
102+
const getKeysSpans = findSpansByMethod('getKeys');
101103
expect(getKeysSpans.length).toBeGreaterThanOrEqual(1);
102104
expect(getKeysSpans[0]?.data).toMatchObject({
103-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_keys',
105+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
104106
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
105107
'db.operation.name': 'getKeys',
106108
'db.system.name': expect.any(String),
107109
});
108110

109111
// Test removeItem spans
110-
const removeItemSpans = findSpansByOp('cache.remove_item');
112+
const removeItemSpans = findSpansByMethod('removeItem');
111113
expect(removeItemSpans.length).toBeGreaterThanOrEqual(1);
112114
const removeItemSpan = removeItemSpans.find(
113115
span => span.data?.[SEMANTIC_ATTRIBUTE_CACHE_KEY] === prefixKey('batch:1'),
114116
);
115117
expect(removeItemSpan).toBeDefined();
116118
expect(removeItemSpan?.data).toMatchObject({
117-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove_item',
119+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
118120
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
119121
[SEMANTIC_ATTRIBUTE_CACHE_KEY]: prefixKey('batch:1'),
120122
'db.operation.name': 'removeItem',
121123
'db.system.name': expect.any(String),
122124
});
123125

124126
// Test clear spans
125-
const clearSpans = findSpansByOp('cache.clear');
127+
const clearSpans = findSpansByMethod('clear');
126128
expect(clearSpans.length).toBeGreaterThanOrEqual(1);
127129
expect(clearSpans[0]?.data).toMatchObject({
128-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.clear',
130+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.remove',
129131
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nitro',
130132
'db.operation.name': 'clear',
131133
'db.system.name': expect.any(String),

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@ 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+
// Several unstorage methods share one convention op (e.g. hasItem/getItem/getKeys are all
23+
// `cache.get`), so spans are located by `db.operation.name`, which stays unique per method.
24+
const findSpansByMethod = (method: string) => {
25+
return transaction.spans?.filter(span => span.data?.['db.operation.name'] === method) || [];
2426
};
2527

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

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

3638
// Find cache miss (first call to getCachedUser('123'))
@@ -42,7 +44,7 @@ test.describe('Cache Instrumentation', () => {
4244
);
4345
if (cacheMissSpan) {
4446
expect(cacheMissSpan.data).toMatchObject({
45-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
47+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
4648
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
4749
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: false,
4850
'db.operation.name': 'getItem',
@@ -59,7 +61,7 @@ test.describe('Cache Instrumentation', () => {
5961
);
6062
if (cacheHitSpan) {
6163
expect(cacheHitSpan.data).toMatchObject({
62-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get_item',
64+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.get',
6365
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
6466
[SEMANTIC_ATTRIBUTE_CACHE_HIT]: true,
6567
'db.operation.name': 'getItem',
@@ -68,7 +70,7 @@ test.describe('Cache Instrumentation', () => {
6870
}
6971

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

7476
const cacheSetSpan = setItemSpans.find(
@@ -78,7 +80,7 @@ test.describe('Cache Instrumentation', () => {
7880
);
7981
if (cacheSetSpan) {
8082
expect(cacheSetSpan.data).toMatchObject({
81-
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.set_item',
83+
[SEMANTIC_ATTRIBUTE_SENTRY_OP]: 'cache.put',
8284
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.cache.nuxt',
8385
'db.operation.name': 'setItem',
8486
'db.collection.name': expect.stringMatching(/^(cache)?$/),
@@ -133,14 +135,10 @@ test.describe('Cache Instrumentation', () => {
133135
expect(allCacheSpans?.length).toBeGreaterThan(0);
134136

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

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

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

0 commit comments

Comments
 (0)