Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(instrumentation-document-load): performance paint timing events #484

Merged
merged 7 commits into from Jun 8, 2021

Conversation

kkruk-sumo
Copy link
Contributor

Which problem is this PR solving?

Added new events to the root span documentLoad:

  • firstPaint
  • firstContentfulPaint

These events can be used in RUM and to better understand website's loading performance.

Short description of the changes

The _getEntries method has been moved to utils as it doesn't need to have class instance. New util addSpanPerformancePaintEvents enhances given span with the collected paint events.

@kkruk-sumo kkruk-sumo requested a review from a team as a code owner May 14, 2021 12:32
@codecov
Copy link

codecov bot commented May 14, 2021

Codecov Report

Merging #484 (367b039) into main (5d73dc2) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #484   +/-   ##
=======================================
  Coverage   94.81%   94.81%           
=======================================
  Files         150      152    +2     
  Lines        9153     9169   +16     
  Branches      904      909    +5     
=======================================
+ Hits         8678     8694   +16     
  Misses        475      475           
Impacted Files Coverage Δ
...strumentation-document-load/src/instrumentation.ts 98.79% <0.00%> (-0.23%) ⬇️
...trumentation-document-load/src/enums/EventNames.ts 100.00% <0.00%> (ø)
...lemetry-instrumentation-document-load/src/utils.ts 100.00% <0.00%> (ø)

Copy link
Member

@johnbley johnbley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good, but I think the event names can be improved.

};

const performancePaintNames = {
'first-paint': EventNames.FIRST_PAINT,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see a lot of dashes in names/semantic conventions in otel... . and _ yes, but not -. Perhaps the camel case names are fine as they are? Most other browser performance event names are passed through unchanged.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So API defines them as first-paint and I proposed to use firstPaint.
The EventNames enum is for our OT enum names and here I define how to map them.
Other events are camel cased and I wanted to follow this convention.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I was reading it backwards! Apologies!

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@johnbley does it mean you are ok with this changes then ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks good. Sorry I didn't officially, approve, will do so.

@obecny
Copy link
Member

obecny commented May 25, 2021

@kkruk-sumo can you please fix the tests, and perhaps allow maintainers to allow changes so this way it will be easier to merge when it is outdated

@kkruk-sumo
Copy link
Contributor Author

@obecny Sorry. Firstly I had issues with eslint (finally found out that I had the wrong eslint version) and then main was failing. Now it passes.

@mhennoch
Copy link
Contributor

LGTM

Copy link
Member

@obecny obecny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@kkruk-sumo
Copy link
Contributor Author

@obecny Can we merge this PR?

@obecny
Copy link
Member

obecny commented Jun 8, 2021

@kkruk-sumo yes, but it cannot be merged until it is rebased with base branch . So please merge with latest or allow editing by maintainers :) thx
#484 (comment)

@kkruk-sumo
Copy link
Contributor Author

@obecny Apologies. I didn't know the PR needs to be up to date. Unfortunately I don't have permissions to allow maintainers to edit this PR or at least I don't see such option.
Branch should be up to main now :)

@obecny obecny merged commit 4a0dab7 into open-telemetry:main Jun 8, 2021
@obecny obecny added the enhancement New feature or request label Jun 8, 2021
@obecny
Copy link
Member

obecny commented Jun 8, 2021

@obecny Apologies. I didn't know the PR needs to be up to date. Unfortunately I don't have permissions to allow maintainers to edit this PR or at least I don't see such option.
Branch should be up to main now :)

merged :), thx for contribution

@kkruk-sumo kkruk-sumo deleted the first_paint_metric branch June 8, 2021 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants