File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed
plugins/web/opentelemetry-instrumentation-document-load/test Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -834,6 +834,27 @@ describe('DocumentLoad Instrumentation', () => {
834834 done ( ) ;
835835 } ) ;
836836 } ) ;
837+
838+ it ( 'should have http.response_content_length attribute even if ignoreNetworkEvents is true' , done => {
839+ plugin = new DocumentLoadInstrumentation ( {
840+ enabled : false ,
841+ ignoreNetworkEvents : true ,
842+ } ) ;
843+ plugin . enable ( ) ;
844+
845+ setTimeout ( ( ) => {
846+ const spans = exporter . getFinishedSpans ( ) ;
847+ const resourceSpan = spans . find (
848+ s => s . name === 'resourceFetch'
849+ ) as ReadableSpan ;
850+ assert . isOk ( resourceSpan , 'resourceFetch span should exist' ) ;
851+ assert . exists (
852+ resourceSpan . attributes [ SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH ] ,
853+ 'http.response_content_length attribute should exist'
854+ ) ;
855+ done ( ) ;
856+ } ) ;
857+ } ) ;
837858 } ) ;
838859} ) ;
839860
You can’t perform that action at this time.
0 commit comments