-
Notifications
You must be signed in to change notification settings - Fork 45
[SLS-1671] Inferred Spans for Kineses, EventBridge, S3, DynamoDB #191
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
Merged
hghotra
merged 7 commits into
inferred-spans-feature-branch
from
hsg/sls-1671-inferred-spans
Nov 5, 2021
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
49db09d
Add kinesis inferred span
hghotra 24df5e0
Add dynamodb inferred span
hghotra 18715ac
Add s3 inferred span
hghotra 64f3db7
Add eventbridge custom event inferred span
hghotra 12b31c5
Comment out flaky units tests (TODO)
hghotra 71c89fd
Add integration tests
hghotra aa22b62
Remove log line
hghotra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "0", | ||
"id": "fd03f394-e769-eff5-08a8-53c228933591", | ||
"detail-type": "testdetail", | ||
"source": "eventbridge.custom.event.sender", | ||
"account": "601427279990", | ||
"time": "2021-11-04T01:37:45Z", | ||
"region": "sa-east-1", | ||
"resources": [], | ||
"detail": { | ||
"foo": "bar" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
{ | ||
"Records": [ | ||
{ | ||
"eventID": "c4ca4238a0b923820dcc509a6f75849b", | ||
"eventName": "INSERT", | ||
"eventVersion": "1.1", | ||
"eventSource": "aws:dynamodb", | ||
"awsRegion": "us-east-1", | ||
"dynamodb": { | ||
"Keys": { | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"NewImage": { | ||
"Message": { | ||
"S": "New item!" | ||
}, | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"ApproximateCreationDateTime": 1428537600, | ||
"SequenceNumber": "4421584500000000017450439091", | ||
"SizeBytes": 26, | ||
"StreamViewType": "NEW_AND_OLD_IMAGES" | ||
}, | ||
"eventSourceARN": "arn:aws:dynamodb:us-east-1:123456789012:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899" | ||
}, | ||
{ | ||
"eventID": "c81e728d9d4c2f636f067f89cc14862c", | ||
"eventName": "MODIFY", | ||
"eventVersion": "1.1", | ||
"eventSource": "aws:dynamodb", | ||
"awsRegion": "us-east-1", | ||
"dynamodb": { | ||
"Keys": { | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"NewImage": { | ||
"Message": { | ||
"S": "This item has changed" | ||
}, | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"OldImage": { | ||
"Message": { | ||
"S": "New item!" | ||
}, | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"ApproximateCreationDateTime": 1428537600, | ||
"SequenceNumber": "4421584500000000017450439092", | ||
"SizeBytes": 59, | ||
"StreamViewType": "NEW_AND_OLD_IMAGES" | ||
}, | ||
"eventSourceARN": "arn:aws:dynamodb:us-east-1:123456789012:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899" | ||
}, | ||
{ | ||
"eventID": "eccbc87e4b5ce2fe28308fd9f2a7baf3", | ||
"eventName": "REMOVE", | ||
"eventVersion": "1.1", | ||
"eventSource": "aws:dynamodb", | ||
"awsRegion": "us-east-1", | ||
"dynamodb": { | ||
"Keys": { | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"OldImage": { | ||
"Message": { | ||
"S": "This item has changed" | ||
}, | ||
"Id": { | ||
"N": "101" | ||
} | ||
}, | ||
"ApproximateCreationDateTime": 1428537600, | ||
"SequenceNumber": "4421584500000000017450439093", | ||
"SizeBytes": 38, | ||
"StreamViewType": "NEW_AND_OLD_IMAGES" | ||
}, | ||
"eventSourceARN": "arn:aws:dynamodb:us-east-1:123456789012:table/ExampleTableWithStream/stream/2015-06-27T00:48:05.899" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"version": "0", | ||
"id": "fd03f394-e769-eff5-08a8-53c228933591", | ||
"detail-type": "testdetail", | ||
"source": "eventbridge.custom.event.sender", | ||
"account": "601427279990", | ||
"time": "2021-11-04T01:37:45Z", | ||
"region": "sa-east-1", | ||
"resources": [], | ||
"detail": { | ||
"foo": "bar" | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"Records": [ | ||
{ | ||
"kinesis": { | ||
"partitionKey": "partitionKey-03", | ||
"kinesisSchemaVersion": "1.0", | ||
"data": "SGVsbG8sIHRoaXMgaXMgYSB0ZXN0IDEyMy4=", | ||
"sequenceNumber": "49545115243490985018280067714973144582180062593244200961", | ||
"approximateArrivalTimestamp": 1428537600 | ||
}, | ||
"eventSource": "aws:kinesis", | ||
"eventID": "shardId-000000000000:49545115243490985018280067714973144582180062593244200961", | ||
"invokeIdentityArn": "arn:aws:iam::EXAMPLE", | ||
"eventVersion": "1.0", | ||
"eventName": "aws:kinesis:record", | ||
"eventSourceARN": "arn:aws:kinesis:EXAMPLE", | ||
"awsRegion": "us-east-1" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"Records": [ | ||
{ | ||
"eventVersion": "2.0", | ||
"eventSource": "aws:s3", | ||
"awsRegion": "us-east-1", | ||
"eventTime": "1970-01-01T00:00:00.000Z", | ||
"eventName": "ObjectCreated:Put", | ||
"userIdentity": { | ||
"principalId": "EXAMPLE" | ||
}, | ||
"requestParameters": { | ||
"sourceIPAddress": "127.0.0.1" | ||
}, | ||
"responseElements": { | ||
"x-amz-request-id": "EXAMPLE123456789", | ||
"x-amz-id-2": "EXAMPLE123/5678abcdefghijklambdaisawesome/mnopqrstuvwxyzABCDEFGH" | ||
}, | ||
"s3": { | ||
"s3SchemaVersion": "1.0", | ||
"configurationId": "testConfigRule", | ||
"bucket": { | ||
"name": "example-bucket", | ||
"ownerIdentity": { | ||
"principalId": "EXAMPLE" | ||
}, | ||
"arn": "arn:aws:s3:::example-bucket" | ||
}, | ||
"object": { | ||
"key": "test/key", | ||
"size": 1024, | ||
"eTag": "0123456789abcdef0123456789abcdef", | ||
"sequencer": "0A1B2C3D4E5F678901" | ||
} | ||
} | ||
} | ||
] | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
long term we might consider a null object pattern for event detection. Not necessary for this PR, just a suggestion
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.
Agreed. One of the reasons this was implemented like this is that the original trigger detection code handles some known events, but also allows "known-unknown" events that just have a raw string in the "source" or "event_source" key. I think the direction in which we're moving is a little bit of a departure from Postel's law. Thats not a bad thing, but we want to make sure we don't lose any functionality.