Skip to content

Support first contentful paint event in document load plugin #26

@8tme

Description

@8tme

What happened?

What happened?

What happened?

Steps to Reproduce

use like this in my react app

  registerInstrumentations({
    instrumentations: [
      new DocumentLoadInstrumentation({}),
    ],
  })

Expected Result

document load span whith 11 events

Image

Actual Result

document load span whith 9 events

Image

Additional Details

After a meticulous investigation, I have identified several potential causes that lead to this issue. when executing

if (!this.getConfig().ignoreNetworkEvents) {
        addSpanNetworkEvents(span, resource);
}

otperformance is always an empty array. I realize that this can only be achieved through asynchronous retrieval.

the code is located here
https://github.com/open-telemetry/opentelemetry-js-contrib/blob/1eb77007669bae87fe5664d68ba6533b95275d52/plugins/web/opentelemetry-instrumentation-document-load/src/instrumentation.ts#L208

by the way, why wasn't there a distinction between node and browser when introducing the platform in opentelemetry-core?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions