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

Add new metric for the "real" Router processing time #4978

Open
smyrick opened this issue Apr 17, 2024 · 3 comments
Open

Add new metric for the "real" Router processing time #4978

smyrick opened this issue Apr 17, 2024 · 3 comments

Comments

@smyrick
Copy link
Member

smyrick commented Apr 17, 2024

Is your feature request related to a problem? Please describe.
Today the metrics apollo_router_http_request_duration_seconds_bucket includes the total HTTP time that supergraph requests see and apollo_router_processing_time includes the time spent processing a request (but outside of waiting for external or subgraph requests) in seconds.

If we have custom extensions like Rhai, Coprocessor, and/or custom Rust plugins then we don't have a good picture of the "real" router overhead minus subgraph time.

Describe the solution you'd like
Add a new metric, something like apollo_router_overhead_time or apollo_router_total_processing_time, that DOES include external and custom plugins.

Describe alternatives you've considered
I could do the math of apollo_router_http_request_duration_seconds_bucket - apollo_router_processing_time + apollo_router_operations_coprocessor.duration + a custom metric I make in my Rust plugins, but that is a lot of work for a simple number

Additional context
The current situations can also lead to a weird issue where the http duration is smaller than processing time: #2906

@xuorig
Copy link
Contributor

xuorig commented Apr 18, 2024

custom Rust plugins

@smyrick are those actually excluded? It didn't look like it to me but let me know if that's really the case 👂

@smyrick
Copy link
Member Author

smyrick commented Apr 19, 2024

Those are not excluded today but just calling out that they should continue to be included in the new metric

@IceHoppr
Copy link

@smyrick it would be great to have existing metric apollo_router_overhead_time exclude the time spent in custom plugins to call external services. One additional new metrics e.g. apollo_router_processing_time can be apollo_router_overhead_time + time spent in external calls in plugins. While the overall request time 'apollo_router_http_request_duration' should be : apollo_router_overhead_time + time spent in external calls in plugins + co-processor processing time + upstream subgraph request processing time.

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

No branches or pull requests

3 participants