feat(bottlecap): add EventBridge inferred spans#436
Merged
alexgallotta merged 16 commits intojordan.gonzalez/bottlecap/universal-instrumentationfrom Nov 11, 2024
Merged
Conversation
7b4d887 to
099b690
Compare
duncanista
reviewed
Nov 6, 2024
duncanista
reviewed
Nov 6, 2024
duncanista
reviewed
Nov 7, 2024
30cefa3 to
bffce63
Compare
bffce63 to
5e6992b
Compare
…to alexgallotta/event-bridge
duncanista
reviewed
Nov 9, 2024
Comment on lines
+42
to
+45
| && payload | ||
| .get("source") | ||
| .and_then(Value::as_str) | ||
| .map_or(false, |s| s != "aws.events") |
duncanista
reviewed
Nov 9, 2024
| pub id: String, | ||
| pub version: String, | ||
| pub account: String, | ||
| pub time: DateTime<Utc>, |
Contributor
There was a problem hiding this comment.
Converted this into DateTime<Utc>
duncanista
reviewed
Nov 9, 2024
Comment on lines
+82
to
+86
| if let Ok(detail) = serde_json::from_value::<HashMap<String, Value>>(self.detail.clone()) { | ||
| if let Some(carrier) = detail.get(DATADOG_CARRIER_KEY) { | ||
| return serde_json::from_value::<HashMap<String, String>>(carrier.clone()) | ||
| .unwrap_or_default(); | ||
| } |
Contributor
There was a problem hiding this comment.
Updated the carrier code here, I really liked how we expect the detail to be a Value, might be really important to do this in every other field which could be a carrier
duncanista
approved these changes
Nov 9, 2024
Contributor
|
Actually, before merging, we might want to use the work @nhulston did to get an accurate time for EventBridge |
duncanista
reviewed
Nov 9, 2024
Comment on lines
+60
to
+67
| let resource_name = carrier | ||
| .get(DATADOG_RESOURCE_NAME_KEY) | ||
| .unwrap_or(&self.source) | ||
| .clone(); | ||
| let start_time = carrier | ||
| .get(DATADOG_START_TIME_KEY) | ||
| .and_then(|s| s.parse::<f64>().ok()) | ||
| .map_or(start_time_seconds, |s| (s * MS_TO_NS) as i64); |
Contributor
There was a problem hiding this comment.
Added resource name and start time accurate resolution when available
8728297
into
jordan.gonzalez/bottlecap/universal-instrumentation
duncanista
added a commit
that referenced
this pull request
Nov 15, 2024
* add eventbridge event * fix test path * add comments with code ref and fix metadata api-gateway * fix error message * clean import * make build faster using host network * fix conflicts and tests * fix test conflicts * resolve merge conflicts * minor changes * add missing unit test * update events for testing * account for millisecond resolution and resource name * fix unit tests * remove `network` tag for runners --------- Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
duncanista
added a commit
that referenced
this pull request
Nov 19, 2024
* add eventbridge event * fix test path * add comments with code ref and fix metadata api-gateway * fix error message * clean import * make build faster using host network * fix conflicts and tests * fix test conflicts * resolve merge conflicts * minor changes * add missing unit test * update events for testing * account for millisecond resolution and resource name * fix unit tests * remove `network` tag for runners --------- Co-authored-by: jordan gonzález <30836115+duncanista@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
add event bridge

change
api_gateway->api-gatewaymetadata as in https://github.com/DataDog/datadog-agent/blob/main/pkg/serverless/invocationlifecycle/constants.go#L45use
CARGO_MANIFEST_DIRin test diruse host network to build bottlecap to speed up build and avoid timeouts
Notes
Not doing EB-SQS or EB-SNS yet