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

Instrument the retrieval latency stages #771

Merged
merged 3 commits into from
Sep 21, 2024

Conversation

jianoaix
Copy link
Contributor

@jianoaix jianoaix commented Sep 20, 2024

Why are these changes needed?

We need visibility to understand the retrieval latency, which sometimes goes above 1s (too high).

Checks

  • I've made sure the lint is passing in this PR.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, in that case, please comment that they are not relevant.
  • I've checked the new test coverage and the coverage percentage didn't drop.
  • Testing Strategy
    • Unit tests
    • Integration tests
    • This PR is not tested :(

@jianoaix jianoaix requested review from dmanc and ian-shim September 20, 2024 23:45
@@ -702,7 +704,7 @@ func (s *DispersalServer) RetrieveBlob(ctx context.Context, req *pb.RetrieveBlob
return nil, api.NewResourceExhaustedError(errorString)
}
}

s.logger.Debug("checked retrieval blob rate limiting", "requesterID", fmt.Sprintf("%s:%s", origin, RetrievalBlobRateType.Plug()), "duration (ms)", time.Since(stageTimer).Milliseconds())
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we name labels camelcase? or time.Since(stageTimer).String() should format it in a human readable way then we probably don't need to indicate the unit in the label

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The mixed cap is pretty compatible with golang. Sounds good to let String() to pretty print.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's compatible in Golang, but doesn't work nicely when filtering by labels in Loki

Copy link
Contributor Author

Choose a reason for hiding this comment

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

feel free to start a conversation on this topic, and if it's indeed a good idea, make a migration cross the board. It's not that useful to start ad hoc style at random places.

@jianoaix jianoaix merged commit e2081ed into Layr-Labs:master Sep 21, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants