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

Emit caching metrics for apollo-datasource-rest #22

Closed
landau opened this issue Sep 16, 2019 · 1 comment
Closed

Emit caching metrics for apollo-datasource-rest #22

landau opened this issue Sep 16, 2019 · 1 comment

Comments

@landau
Copy link

landau commented Sep 16, 2019

Package: apollo-datasource-rest

It would be useful to emit metrics around caching. More specifically, some boolean value that indicates when a request results from the cache vs HTTP. In this way, I would be able to emit metrics for my application and adjust TTLs based on those statistics https://github.com/apollographql/apollo-server/blob/master/packages/apollo-datasource-rest/src/HTTPCache.ts#L116-L146

Thank you

@glasser glasser transferred this issue from apollographql/apollo-server Oct 11, 2022
@glasser
Copy link
Member

glasser commented Dec 14, 2022

We're going to solve #41 by making each fetch call return information about whether or not the call was cached. You can override the protected fetch method in your subclass to look at this information and feed it into your metrics system if you'd like. So I'm considering this (old, sorry!) issue to be a duplicate of #41.

@glasser glasser closed this as not planned Won't fix, can't repro, duplicate, stale Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants