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

Instrument context failures and Instrument conn latency #79

Merged
merged 2 commits into from
Apr 5, 2023

Conversation

aarshkshah1992
Copy link
Contributor

No description provided.

Copy link
Contributor

@willscott willscott left a comment

Choose a reason for hiding this comment

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

remove the extraneous block before merge

fetcher.go Outdated
if err != nil {
return
}

response_success_end = time.Now()
{
Copy link
Contributor

Choose a reason for hiding this comment

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

why is this in a block?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed

@aarshkshah1992 aarshkshah1992 merged commit 9274f9a into main Apr 5, 2023
@aarshkshah1992 aarshkshah1992 deleted the feat/http-request-tracing branch April 5, 2023 13:22
@@ -71,6 +72,11 @@ func (p *pool) fetchResource(ctx context.Context, from string, resource string,
if mime == "application/vnd.ipld.raw" {
resourceType = "block"
}
fetchCalledTotalMetric.WithLabelValues(resourceType).Add(1)
if ctx.Err() != nil {
fetchRequestContextErrorTotalMetric.WithLabelValues(resourceType, ctx.Err().Error(), "init").Add(1)
Copy link
Contributor

@lidel lidel Apr 5, 2023

Choose a reason for hiding this comment

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

⚠️ @aarshkshah1992 @willscott this is potentially really really bad, because you have unbounded number of values .Error() could return, which will in turn baloon the size of metrics.

Last time I checked we had errors which had the URL / CID of failed request, and that means some errors will be unique .Error() string , exploding metrics space:

http request failed: Get \"https://64.44.166.190/ipfs/bafybeiaysi4s6lnjev27ln5icwm6tueaw2vdykrtjkwiphwekaywqhcjze/favicon.ico?format=car&depth=0\": context canceled

Maybe log some higher level error type instead? (or a flag to indicate context cancelled or not)

Copy link
Contributor

Choose a reason for hiding this comment

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

#81

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lidel Thanks for catching this ! In my mind, the context cancelled error could only be Cancelled or Dead line exceeded ! But I see now.

lidel added a commit to ipfs-inactive/bifrost-gateway that referenced this pull request Apr 5, 2023
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.

None yet

3 participants