@@ -38,14 +38,15 @@ test.describe('Storage Instrumentation', () => {
3838 expect ( setItemSpan ) . toBeDefined ( ) ;
3939 expect ( setItemSpan ?. attributes ) . toMatchObject ( {
4040 'sentry.op' : { type : 'string' , value : 'cache.put' } ,
41+ 'cache.operation' : { type : 'string' , value : 'put' } ,
4142 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
4243 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
4344 'db.operation.name' : { type : 'string' , value : 'setItem' } ,
4445 'db.collection.name' : { type : 'string' , value : 'test-storage' } ,
4546 'db.system.name' : { type : 'string' , value : 'memory' } ,
4647 } ) ;
4748
48- expect ( setItemSpan ?. name ) . toBe ( prefixKey ( 'user:123' ) ) ;
49+ expect ( setItemSpan ?. name ) . toBe ( 'cache.put' ) ;
4950
5051 // Test setItemRaw spans
5152 expect ( findSpansByMethod ( 'setItemRaw' ) . length ) . toBeGreaterThanOrEqual ( 1 ) ;
@@ -54,6 +55,7 @@ test.describe('Storage Instrumentation', () => {
5455 expect ( setItemRawSpan ) . toBeDefined ( ) ;
5556 expect ( setItemRawSpan ?. attributes ) . toMatchObject ( {
5657 'sentry.op' : { type : 'string' , value : 'cache.put' } ,
58+ 'cache.operation' : { type : 'string' , value : 'put' } ,
5759 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
5860 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'raw:data' ) } ,
5961 'db.operation.name' : { type : 'string' , value : 'setItemRaw' } ,
@@ -67,6 +69,7 @@ test.describe('Storage Instrumentation', () => {
6769 expect ( hasItemSpan ) . toBeDefined ( ) ;
6870 expect ( hasItemSpan ?. attributes ) . toMatchObject ( {
6971 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
72+ 'cache.operation' : { type : 'string' , value : 'get' } ,
7073 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
7174 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
7275 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
@@ -81,21 +84,23 @@ test.describe('Storage Instrumentation', () => {
8184 expect ( getItemSpan ) . toBeDefined ( ) ;
8285 expect ( getItemSpan ?. attributes ) . toMatchObject ( {
8386 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
87+ 'cache.operation' : { type : 'string' , value : 'get' } ,
8488 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
8589 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
8690 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
8791 'db.operation.name' : { type : 'string' , value : 'getItem' } ,
8892 'db.collection.name' : { type : 'string' , value : 'test-storage' } ,
8993 'db.system.name' : { type : 'string' , value : 'memory' } ,
9094 } ) ;
91- expect ( getItemSpan ?. name ) . toBe ( prefixKey ( 'user:123' ) ) ;
95+ expect ( getItemSpan ?. name ) . toBe ( 'cache.get' ) ;
9296
9397 // Test getItemRaw spans - should have cache hit attribute
9498 expect ( findSpansByMethod ( 'getItemRaw' ) . length ) . toBeGreaterThanOrEqual ( 1 ) ;
9599 const getItemRawSpan = findSpanByCacheKey ( 'getItemRaw' , prefixKey ( 'raw:data' ) ) ;
96100 expect ( getItemRawSpan ) . toBeDefined ( ) ;
97101 expect ( getItemRawSpan ?. attributes ) . toMatchObject ( {
98102 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
103+ 'cache.operation' : { type : 'string' , value : 'get' } ,
99104 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
100105 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'raw:data' ) } ,
101106 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
@@ -109,6 +114,7 @@ test.describe('Storage Instrumentation', () => {
109114 expect ( getKeysSpans . length ) . toBeGreaterThanOrEqual ( 1 ) ;
110115 expect ( getKeysSpans [ 0 ] ?. attributes ) . toMatchObject ( {
111116 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
117+ 'cache.operation' : { type : 'string' , value : 'get' } ,
112118 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
113119 'db.operation.name' : { type : 'string' , value : 'getKeys' } ,
114120 'db.collection.name' : { type : 'string' , value : 'test-storage' } ,
@@ -121,6 +127,7 @@ test.describe('Storage Instrumentation', () => {
121127 expect ( removeItemSpan ) . toBeDefined ( ) ;
122128 expect ( removeItemSpan ?. attributes ) . toMatchObject ( {
123129 'sentry.op' : { type : 'string' , value : 'cache.remove' } ,
130+ 'cache.operation' : { type : 'string' , value : 'remove' } ,
124131 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
125132 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'batch:1' ) } ,
126133 'db.operation.name' : { type : 'string' , value : 'removeItem' } ,
@@ -133,6 +140,7 @@ test.describe('Storage Instrumentation', () => {
133140 expect ( clearSpans . length ) . toBeGreaterThanOrEqual ( 1 ) ;
134141 expect ( clearSpans [ 0 ] ?. attributes ) . toMatchObject ( {
135142 'sentry.op' : { type : 'string' , value : 'cache.remove' } ,
143+ 'cache.operation' : { type : 'string' , value : 'remove' } ,
136144 'sentry.origin' : { type : 'string' , value : 'auto.cache.nuxt' } ,
137145 'db.operation.name' : { type : 'string' , value : 'clear' } ,
138146 'db.collection.name' : { type : 'string' , value : 'test-storage' } ,
0 commit comments