artsy / metaphysics

Artsy's GraphQL API
MIT License
360 stars 89 forks source link

feat(home view): allow per-env timeout for shows resolver #6123

Closed anandaroop closed 1 month ago

anandaroop commented 1 month ago

Follow-up to this discussion

This tweaks the ShowsForYou resolver — known to be slow — to allow a more generous timeout in dev/staging, while still honoring the HOME_VIEW_RESOLVER_TIMEOUT_MS env var in production.

mzikherman commented 1 month ago

The endpoint me/shows comes up in DataDog as a really slow endpoint - https://app.datadoghq.com/apm/resource/gravity/rack.request/96fe8e44a96ff64d?query=env%3Aproduction%20operation_name%3Arack.request%20service%3Agravity&env=production&fromUser=false&graphType=flamegraph&resourceMapPrefs=qson%3A%28data%3A%28threshold%3A%210.1%29%2Cversion%3A%210%29&shouldShowLegend=true&sort=time&summary=qson%3A%28data%3A%28visible%3A%21t%2Cchanges%3A%28%29%2Cerrors%3A%28selected%3Acount%29%2Chits%3A%28selected%3Acount%29%2Clatency%3A%28selected%3Alatency%2Cslot%3A%28agg%3A95%29%2Cdistribution%3A%28isLogScale%3A%21f%29%2CshowTraceOutliers%3A%21t%29%2Csublayer%3A%28slot%3A%28layers%3Aservice%29%2Cselected%3Aabsolute%29%2ClagMetrics%3A%28selectedMetric%3A%21s%2CselectedGroupBy%3A%21s%29%29%2Cversion%3A%211%29&traces=qson%3A%28data%3A%28%29%2Cversion%3A%210%29&start=1728513385312&end=1728599785312&paused=false

looks due to the now-much-slower counts present after a recent Mongo upgrade (the estimated_count vs count thing, may need some index double-checking) - https://artsy.slack.com/archives/C02JHHHKP5K/p1726154574145689