Skip to content
This repository has been archived by the owner on Jun 20, 2024. It is now read-only.

Support Server-Timing header #69

Open
1 of 4 tasks
lidel opened this issue Mar 30, 2023 · 2 comments
Open
1 of 4 tasks

Support Server-Timing header #69

lidel opened this issue Mar 30, 2023 · 2 comments

Comments

@lidel
Copy link
Collaborator

lidel commented Mar 30, 2023

TODO

This feature may be useful enough to be promoted upstream:

  • support timing info from caboose support in feat: add Server-Timing headers #71.
  • add gateway-related timing here
  • evaluate usefullness
  • decision to move middleware to upstream boxo/gateway library

What and why

Ref. https://www.w3.org/TR/server-timing/

TLDR: we want to leverage UI in modern browsers to give more info about where Gateway request was spent:


Source: https://ma.ttias.be/server-timings-chrome-devtools/

How

TBD, there is a library at https://github.com/mitchellh/go-server-timing + slack thread

Middleware for injecting the server timing struct into the request Context and writing the Server-Timing header.

there is slight risk middleware will not be compatible with how we do subdomains, but that is tbd.
we can give it a try in bifrost-gateway and see how it goes.

on the surface level it sounds sensible,

@lidel
Copy link
Collaborator Author

lidel commented Mar 31, 2023

@hacdias as a PoC, we could give it a try by exposing a single value (e.g. one passet to i.getMetric here to test things end-to-end.

@willscott @aschmahmann
FYI I am adding more meaningful metrics and tracing spans in ipfs/boxo#245, we might be able to leverage ipfsBackendWithMetrics for exposing timing details per IPFSBackend api call via Server-Timing header.

@lidel
Copy link
Collaborator Author

lidel commented Apr 3, 2023

basic support landed in #71, added remaining TODO section to the top of this issue

what gateway-related timing info should we return? Amount each IPFSBackend call took?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants