-
Notifications
You must be signed in to change notification settings - Fork 593
HDDS-9718. Add performance audit logging for S3G #5644
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
Changes from all commits
ba79346
20ee396
547c655
dca2929
e7cb430
89f0520
8731528
8fa3e11
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,6 +69,7 @@ | |
| import java.util.List; | ||
| import java.util.Set; | ||
|
|
||
| import static org.apache.hadoop.ozone.audit.AuditLogger.PerformanceStringBuilder; | ||
| import static org.apache.hadoop.ozone.OzoneAcl.AclScope.ACCESS; | ||
| import static org.apache.hadoop.ozone.OzoneConsts.OZONE_URI_DELIMITER; | ||
| import static org.apache.hadoop.ozone.s3.S3GatewayConfigKeys.OZONE_S3G_LIST_KEYS_SHALLOW_ENABLED; | ||
|
|
@@ -113,6 +114,8 @@ public Response get( | |
| @Context HttpHeaders hh) throws OS3Exception, IOException { | ||
| long startNanos = Time.monotonicNowNanos(); | ||
| S3GAction s3GAction = S3GAction.GET_BUCKET; | ||
| PerformanceStringBuilder perf = new PerformanceStringBuilder(); | ||
|
|
||
| Iterator<? extends OzoneKey> ozoneKeyIterator; | ||
| ContinueToken decodedToken = | ||
| ContinueToken.decodeFromString(continueToken); | ||
|
|
@@ -264,12 +267,15 @@ public Response get( | |
| response.setTruncated(false); | ||
| } | ||
|
|
||
| AUDIT.logReadSuccess(buildAuditMessageForSuccess(s3GAction, | ||
| getAuditParameters())); | ||
| int keyCount = | ||
| response.getCommonPrefixes().size() + response.getContents().size(); | ||
| getMetrics().updateGetBucketSuccessStats(startNanos); | ||
| long opLatencyNs = | ||
| getMetrics().updateGetBucketSuccessStats(startNanos); | ||
| getMetrics().incListKeyCount(keyCount); | ||
| perf.appendCount(keyCount); | ||
| perf.appendOpLatencyNanos(opLatencyNs); | ||
| AUDIT.logReadSuccess(buildAuditMessageForSuccess(s3GAction, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a problem that deserves attention
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree that the problem also applies to the existing, "functional" part of the audit message. Audit logging is enabled by default, and we need several changes to improve it, so I think we should do it separately.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reopened HDDS-2638 for the improvement of audit message processsing/allocations. |
||
| getAuditParameters(), perf.build())); | ||
| response.setKeyCount(keyCount); | ||
| return Response.ok(response).build(); | ||
| } | ||
|
|
||
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.
Let's call it
COPY_MULTIPART_KEY?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.
I'm referencing the AWS API name
CREATE_MULTIPART_KEY: AWS API nameUploadPartCREATE_MULTIPART_KEY_BY_COPY: AWS API nameUploadPartCopyI think it's a better match, what do you think?
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.
Sure. Let's keep it then.