Skip to content

[WIP] Add support for Server Timing headers#1490

Closed
stipsan wants to merge 2 commits into
apollographql:mainfrom
stipsan:server-timing
Closed

[WIP] Add support for Server Timing headers#1490
stipsan wants to merge 2 commits into
apollographql:mainfrom
stipsan:server-timing

Conversation

@stipsan

@stipsan stipsan commented Aug 5, 2018

Copy link
Copy Markdown

This PR is not merge ready, I'm opening it early to discuss the prospect of the feature itself and if I'm on the right track with it or not.

The Server Timing headers enable more information in the Chrome DevTools on each individual request:

skjermbilde 2018-08-05 kl 17 29 30

View larger image with more context. skjermbilde 2018-08-05 kl 17 30 45

Server Timing information is complimentary to existing tracing information. Some of its constraints is that you can only specify a duration per field, no start or end times to create a timeline context in relation to the other fields that might happen in parallel or before/after one another.

It's very suitable to show a brief overview over where the most time were spent in a query. This PR walks through the tracing information in the response and reduces it to the longest duration per path.

Looking forward to your feedback 😄

TODO:

  • Update CHANGELOG.md with your change (include reference to issue & this PR)
  • Make sure all of the significant new logic is covered by tests
  • Rebase your changes on master so that they can be merged easily
  • Make sure all tests and linter rules pass

Pull Request Labels

  • feature
  • blocking
  • docs

@ghost ghost added the ⛲️ feature New addition or enhancement to existing solutions label Aug 5, 2018
@hwillson hwillson changed the title Add support for Server Timing headers [WIP] Add support for Server Timing headers Nov 14, 2018
@abernix abernix closed this Jun 24, 2020
@abernix abernix reopened this Jun 25, 2020
@abernix abernix changed the base branch from master to main June 25, 2020 09:05
@pranaygp

pranaygp commented Jul 5, 2020

Copy link
Copy Markdown

ETA on this being merged @abernix / @stipsan?

I'm considering rolling it myself (referencing the work done in this PR) for my apollo server instance

@stipsan

stipsan commented Jul 6, 2020

Copy link
Copy Markdown
Author

@pranaygp well I’ve been waiting for feedback for a while now. I wouldn’t hold my breath 😉

@glasser

glasser commented Oct 4, 2022

Copy link
Copy Markdown
Member

I think this could be built as a plugin using willResolveField just like the usage reporting plugin does. (When this PR was written, willResolveField didn't exist; it was added in #3988.) It thus doesn't need to be part of the core project.

@glasser glasser closed this Oct 4, 2022
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Apr 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

⛲️ feature New addition or enhancement to existing solutions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants