Skip to content

feat(bottlecap): allow wrapped inferred spans + add SNS-SQS inferred spans#440

Merged
duncanista merged 46 commits intojordan.gonzalez/bottlecap/universal-instrumentationfrom
jordan.gonzalez/bottlecap/sns-sqs
Nov 8, 2024
Merged

feat(bottlecap): allow wrapped inferred spans + add SNS-SQS inferred spans#440
duncanista merged 46 commits intojordan.gonzalez/bottlecap/universal-instrumentationfrom
jordan.gonzalez/bottlecap/sns-sqs

Conversation

@duncanista
Copy link
Copy Markdown
Contributor

What?

Support SNS-SQS inferred spans
image

How?

Simplified the logic since we are introducing another span to be added.
Created the carrier for SNS inside the SQS get_carrier trigger. Its simpler logic-wise. Although we pay a small cost of double parsing the same wrapped event (see the sqs_event.rs trigger and the span_inferrer.rs for SqsRecord).

Notes

Moved some logic so we can have a wrapped_inferred_span which should only appear in certain spaces.
Not making it an array, since we are not going to do more than 1 hop.

astuyve and others added 30 commits October 23, 2024 13:27
or else theres nothing to extract, reset values also for next inferr, no need to keep state after we complete
and also move some variables
@duncanista duncanista requested a review from a team as a code owner November 8, 2024 19:03
Base automatically changed from jordan.gonzalez/bottlecap/sns to jordan.gonzalez/bottlecap/universal-instrumentation November 8, 2024 20:13
@duncanista duncanista merged commit 1c17830 into jordan.gonzalez/bottlecap/universal-instrumentation Nov 8, 2024
@duncanista duncanista deleted the jordan.gonzalez/bottlecap/sns-sqs branch November 8, 2024 20:21
duncanista added a commit that referenced this pull request Nov 15, 2024
…spans (#440)

* wip: sqs

* feat: sqs tests

* invert duration check

* remove duration set

* fmt and add `test_get_arn`

* remove unneeded reference

* remove unneeded comments

* add `get_carrier` implementation for `SqsRecord`

* add trace context to `sqs_event.json`

* fix: resource_names is not needed

* fix: don't deserialize body

* avoid `use super::...`

* fix unit tests

* set carrier and trigger tags

* remove duplicate tag

* fmt

* pass headers to `on_invocation_end`

* infer first, then extract

or else theres nothing to extract, reset values also for next inferr, no need to keep state after we complete

* reset values on every infer

* add `sns_event.rs`

* add `sns_event*.json` payloads

* add `base64_to_string` method

and also move some variables

* surrender resource

* use `SnsRecord` for inferred spans

* move some constants

* add missing trigger tags

* missed one case

* update unit tests

* update `tt` to `t.get_tags()`

* fmt

* typo

* update tags

* SQS event can contain SNS carrier

* make some `Trigger` methods to be `Sized`

* add `sns_sqs_event.json`

also update path

* account for wrapped inferred span in processor

* simplify code in `span_inferrer.rs`

* remove duplicated condition

---------

Co-authored-by: AJ Stuyvenberg <astuyve@gmail.com>
duncanista added a commit that referenced this pull request Nov 19, 2024
…spans (#440)

* wip: sqs

* feat: sqs tests

* invert duration check

* remove duration set

* fmt and add `test_get_arn`

* remove unneeded reference

* remove unneeded comments

* add `get_carrier` implementation for `SqsRecord`

* add trace context to `sqs_event.json`

* fix: resource_names is not needed

* fix: don't deserialize body

* avoid `use super::...`

* fix unit tests

* set carrier and trigger tags

* remove duplicate tag

* fmt

* pass headers to `on_invocation_end`

* infer first, then extract

or else theres nothing to extract, reset values also for next inferr, no need to keep state after we complete

* reset values on every infer

* add `sns_event.rs`

* add `sns_event*.json` payloads

* add `base64_to_string` method

and also move some variables

* surrender resource

* use `SnsRecord` for inferred spans

* move some constants

* add missing trigger tags

* missed one case

* update unit tests

* update `tt` to `t.get_tags()`

* fmt

* typo

* update tags

* SQS event can contain SNS carrier

* make some `Trigger` methods to be `Sized`

* add `sns_sqs_event.json`

also update path

* account for wrapped inferred span in processor

* simplify code in `span_inferrer.rs`

* remove duplicated condition

---------

Co-authored-by: AJ Stuyvenberg <astuyve@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants