@@ -40,19 +40,21 @@ test.describe('Storage Instrumentation', () => {
4040 expect ( setItemSpan ) . toBeDefined ( ) ;
4141 expect ( setItemSpan ?. attributes ) . toMatchObject ( {
4242 'sentry.op' : { type : 'string' , value : 'cache.put' } ,
43+ 'cache.operation' : { type : 'string' , value : 'put' } ,
4344 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
4445 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
4546 'db.operation.name' : { type : 'string' , value : 'setItem' } ,
4647 'db.system.name' : { type : 'string' , value : expect . any ( String ) } ,
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 ) ;
5253 const setItemRawSpan = findSpanByCacheKey ( 'setItemRaw' , prefixKey ( 'raw:data' ) ) ;
5354 expect ( setItemRawSpan ) . toBeDefined ( ) ;
5455 expect ( setItemRawSpan ?. attributes ) . toMatchObject ( {
5556 'sentry.op' : { type : 'string' , value : 'cache.put' } ,
57+ 'cache.operation' : { type : 'string' , value : 'put' } ,
5658 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
5759 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'raw:data' ) } ,
5860 'db.operation.name' : { type : 'string' , value : 'setItemRaw' } ,
@@ -65,6 +67,7 @@ test.describe('Storage Instrumentation', () => {
6567 expect ( hasItemSpan ) . toBeDefined ( ) ;
6668 expect ( hasItemSpan ?. attributes ) . toMatchObject ( {
6769 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
70+ 'cache.operation' : { type : 'string' , value : 'get' } ,
6871 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
6972 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
7073 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
@@ -78,20 +81,22 @@ test.describe('Storage Instrumentation', () => {
7881 expect ( getItemSpan ) . toBeDefined ( ) ;
7982 expect ( getItemSpan ?. attributes ) . toMatchObject ( {
8083 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
84+ 'cache.operation' : { type : 'string' , value : 'get' } ,
8185 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
8286 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'user:123' ) } ,
8387 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
8488 'db.operation.name' : { type : 'string' , value : 'getItem' } ,
8589 'db.system.name' : { type : 'string' , value : expect . any ( String ) } ,
8690 } ) ;
87- expect ( getItemSpan ?. name ) . toBe ( prefixKey ( 'user:123' ) ) ;
91+ expect ( getItemSpan ?. name ) . toBe ( 'cache.get' ) ;
8892
8993 // Test getItemRaw spans - should have cache hit attribute
9094 expect ( findSpansByMethod ( 'getItemRaw' ) . length ) . toBeGreaterThanOrEqual ( 1 ) ;
9195 const getItemRawSpan = findSpanByCacheKey ( 'getItemRaw' , prefixKey ( 'raw:data' ) ) ;
9296 expect ( getItemRawSpan ) . toBeDefined ( ) ;
9397 expect ( getItemRawSpan ?. attributes ) . toMatchObject ( {
9498 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
99+ 'cache.operation' : { type : 'string' , value : 'get' } ,
95100 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
96101 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'raw:data' ) } ,
97102 [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] : { type : 'boolean' , value : true } ,
@@ -104,6 +109,7 @@ test.describe('Storage Instrumentation', () => {
104109 expect ( getKeysSpans . length ) . toBeGreaterThanOrEqual ( 1 ) ;
105110 expect ( getKeysSpans [ 0 ] ?. attributes ) . toMatchObject ( {
106111 'sentry.op' : { type : 'string' , value : 'cache.get' } ,
112+ 'cache.operation' : { type : 'string' , value : 'get' } ,
107113 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
108114 'db.operation.name' : { type : 'string' , value : 'getKeys' } ,
109115 'db.system.name' : { type : 'string' , value : expect . any ( String ) } ,
@@ -115,6 +121,7 @@ test.describe('Storage Instrumentation', () => {
115121 expect ( removeItemSpan ) . toBeDefined ( ) ;
116122 expect ( removeItemSpan ?. attributes ) . toMatchObject ( {
117123 'sentry.op' : { type : 'string' , value : 'cache.remove' } ,
124+ 'cache.operation' : { type : 'string' , value : 'remove' } ,
118125 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
119126 [ SEMANTIC_ATTRIBUTE_CACHE_KEY ] : { type : 'string' , value : prefixKey ( 'batch:1' ) } ,
120127 'db.operation.name' : { type : 'string' , value : 'removeItem' } ,
@@ -126,6 +133,7 @@ test.describe('Storage Instrumentation', () => {
126133 expect ( clearSpans . length ) . toBeGreaterThanOrEqual ( 1 ) ;
127134 expect ( clearSpans [ 0 ] ?. attributes ) . toMatchObject ( {
128135 'sentry.op' : { type : 'string' , value : 'cache.remove' } ,
136+ 'cache.operation' : { type : 'string' , value : 'remove' } ,
129137 'sentry.origin' : { type : 'string' , value : 'auto.cache.nitro' } ,
130138 'db.operation.name' : { type : 'string' , value : 'clear' } ,
131139 'db.system.name' : { type : 'string' , value : expect . any ( String ) } ,
0 commit comments