-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Track PUT/PUT_BLOCK operations on AzureBlobStore. #56936
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
Conversation
|
Pinging @elastic/es-distributed (:Distributed/Snapshot/Restore) |
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor point on the accuracy of the matching, looks good in general. Thanks!
| String queryParams = httpURLConnection.getURL().getQuery(); | ||
| // https://docs.microsoft.com/en-us/rest/api/storageservices/put-block | ||
| // https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-list | ||
| if (queryParams != null && (queryParams.contains("comp=block") || queryParams.contains("comp=blocklist"))) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
queryParams.contains("comp=blocklist") is redundant isn't it?
Might be safer to require a blockid= as well if we just see a comp=block just to make sure we're in line with expectations on the API requests we'll see here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I've just added an additional condition to ensure that we're really matching against a PutBlock request. Thanks!
| // https://docs.microsoft.com/en-us/rest/api/storageservices/put-block | ||
| // https://docs.microsoft.com/en-us/rest/api/storageservices/put-block-list | ||
| private boolean isBlockUpload(String request) { | ||
| return Regex.simpleMatch("PUT /*/*?*comp=blocklist*", request) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sam as in the production code, matching on comp=blocklist seems redundant when matching comp=block?
| return; | ||
| } | ||
|
|
||
| stats.getOperations.incrementAndGet(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semi-related to this PR since you did it in the new collector, let's add assertions in spots like this one to make sure, we're actually seeing a GET here :) Can probably do the same for the list collector also.
original-brownbear
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks Francisco!
Add tracking for regular and block uploads on AzureBlobStore