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

add latency / size metrics for error cases #32

Merged
merged 2 commits into from
Feb 20, 2023
Merged

Conversation

willscott
Copy link
Contributor

report these even in error cases

Copy link
Contributor

@lidel lidel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm (it was bit hairy so cleaned it up, and deduplicated calculation between logs and metrics)

ps. I think "Speed" one may not be correctly represented at bifrost-gw-staging-metrics, Y-axis should be something like bytes/second, and not seconds(?). (will update staging to ipfs-inactive/bifrost-gateway@e4d22d2 binary with this PR, and we will ping George later this week if its still wonky)

goLogger.Debugw("fetch result", "from", from, "of", c, "status", code, "size", received, "ttfb", int(fb.Sub(start).Milliseconds()), "duration", time.Since(start).Seconds())
ttfbMs := fb.Sub(start).Milliseconds()
durationSecs := time.Since(start).Seconds()
goLogger.Debugw("fetch result", "from", from, "of", c, "status", code, "size", received, "ttfb", int(ttfbMs), "duration", durationSecs, "attempt", attempt, "error", e)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ replaced two debugs logs per request with one (success will have error equal null here)

lidel added a commit to ipfs-inactive/bifrost-gateway that referenced this pull request Feb 20, 2023
@willscott willscott merged commit ebf9e25 into main Feb 20, 2023
@willscott willscott deleted the fix/error-metrics branch February 20, 2023 00:50
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants