@@ -36,25 +36,28 @@ sentryTest('manual LangChain instrumentation sends gen_ai transactions', async (
3636 } ) ;
3737} ) ;
3838
39- sentryTest ( 'manual LangChain embeddings instrumentation sends gen_ai transactions' , async ( { getLocalTestUrl, page } ) => {
40- const transactionPromise = waitForTransactionRequest ( page , event => {
41- return ! ! event . transaction ?. includes ( 'text-embedding-3-small' ) ;
42- } ) ;
43-
44- const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
45- await page . goto ( url ) ;
46-
47- const req = await transactionPromise ;
48-
49- const eventData = envelopeRequestParser ( req ) ;
50-
51- expect ( eventData . transaction ) . toBe ( 'embeddings text-embedding-3-small' ) ;
52- expect ( eventData . contexts ?. trace ?. op ) . toBe ( 'gen_ai.embeddings' ) ;
53- expect ( eventData . contexts ?. trace ?. origin ) . toBe ( 'auto.ai.langchain' ) ;
54- expect ( eventData . contexts ?. trace ?. data ) . toMatchObject ( {
55- 'gen_ai.operation.name' : 'embeddings' ,
56- 'gen_ai.system' : 'openai' ,
57- 'gen_ai.request.model' : 'text-embedding-3-small' ,
58- 'gen_ai.request.dimensions' : 1536 ,
59- } ) ;
60- } ) ;
39+ sentryTest (
40+ 'manual LangChain embeddings instrumentation sends gen_ai transactions' ,
41+ async ( { getLocalTestUrl, page } ) => {
42+ const transactionPromise = waitForTransactionRequest ( page , event => {
43+ return ! ! event . transaction ?. includes ( 'text-embedding-3-small' ) ;
44+ } ) ;
45+
46+ const url = await getLocalTestUrl ( { testDir : __dirname } ) ;
47+ await page . goto ( url ) ;
48+
49+ const req = await transactionPromise ;
50+
51+ const eventData = envelopeRequestParser ( req ) ;
52+
53+ expect ( eventData . transaction ) . toBe ( 'embeddings text-embedding-3-small' ) ;
54+ expect ( eventData . contexts ?. trace ?. op ) . toBe ( 'gen_ai.embeddings' ) ;
55+ expect ( eventData . contexts ?. trace ?. origin ) . toBe ( 'auto.ai.langchain' ) ;
56+ expect ( eventData . contexts ?. trace ?. data ) . toMatchObject ( {
57+ 'gen_ai.operation.name' : 'embeddings' ,
58+ 'gen_ai.system' : 'openai' ,
59+ 'gen_ai.request.model' : 'text-embedding-3-small' ,
60+ 'gen_ai.request.dimensions' : 1536 ,
61+ } ) ;
62+ } ,
63+ ) ;
0 commit comments