-
Notifications
You must be signed in to change notification settings - Fork 15
auditing - initial changes #280
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
| public class StreamContext { | ||
| private final String spanId; | ||
| private final String operationName; | ||
| } |
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.
should we be removing the referrer header builder support?
| final String referrerHeader; | ||
| AwsRequestOverrideConfiguration.Builder requestOverrideConfigurationBuilder = | ||
| AwsRequestOverrideConfiguration.builder() | ||
| .putHeader(HEADER_REFERER, getRequest.getReferrer().toString()) |
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.
can we have all the request related constants like HEADER_REFERER and HEADER_USER_AGENT also as part of the request attributes class?
| public String modifyAndBuildReferrerHeader(GetRequest getRequestContext); | ||
| @Builder(access = AccessLevel.PUBLIC) | ||
| @Getter | ||
| public class StreamContext { |
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.
Nit: Should we rename this class to better reflect its auditing-specific purpose? like StreamAuditingContext
Description of change
S3A PR: apache/hadoop#7723
Use executionAttributes to attach the correct span to each get request made for a stream.
S3A generates a
span_idfor each operation. For example, when a stream to an object is opened in S3A'sexecuteOpen(), a span_id is generated for this operation. TheexecuteOpen()operation is also given the nameop_open.This
span_idis then used to log any S3 requests that happened for the operation in S3A's LoggingAuditor. For example, for anexecuteOpen(), there can be a HEAD request, and a GET request, and these show up in the logs as:The
84ca7693-a471-4564-a6b9-70b6424548c4-00000009is the span-id. From the above logs, we can decipher exactly what S3 requests were made per operation, which helps in debugging.Since the S3 GETs are now made in AAL, we must find a way to attach these back to the correct span and operation. This is done as follows:
span_idandoperation_nameof the stream. Thisspan_idis generated at stream creation time.ExecutionAttributes.S3A's LoggingAuditor will then be able to access these in it's ExecutionInterceptor, and use it for it's logging and building the referrer header.
Relevant issues
Does this contribution introduce any breaking changes to the existing APIs or behaviors?
Does this contribution introduce any new public APIs or behaviors?
How was the contribution tested?
Does this contribution need a changelog entry?
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).