-
Notifications
You must be signed in to change notification settings - Fork 45
Inferred spans for AWS Managed Services #204
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
* Infer spans from API Gateway events * Adding some prints. remove later * Change some info on the API Gateway span * Rename something * black * >:( * black * fix time * Support various API Gateway, HTTPAPI, and Websocket events * black * Add DD_INFERRED_SPANS env var to turn inferred spans on and off * infer spans in integration tests * specify which env var to set true in order to enable inferred spans * try setting inferred span name to inferred span URL * s/beta/experimental/ * Correctly create spans in separate services, assuming the extension is running and the tag is not set on the function * Remove function_name * Flush after closing spans * black * black * update snapshots * Make the snapshots valid json * black * Remove the inferredSpansFilter * Refactor inferred-span event type detection to use the trigger event type code * remove unused import * lines too long >=( * Finish refactor using _EventSource object * lol, remove println debugging * Update snapshots
* Simplify event source parsing logic * Add sns & sqs inferred spans * Fix default evt source bug & update comments * Use poetry for running unit tests * Add additional api gateway trigger tests * Fix bugs & refactor * Add inferred spans unit tests * Update integration tests * Run all tests for all python versions * Add missing change * Update _dd.span_type to span_type * Remove dependence on extension * Additional api gateway test * Remove log line & add todo * Fix api gateway integration test * Move call to get_first_record
* Add kinesis inferred span * Add dynamodb inferred span * Add s3 inferred span * Add eventbridge custom event inferred span * Comment out flaky units tests (TODO) * Add integration tests * Remove log line
… value (#195) * Add sync/async tag to inferred spans * End inferred span based on sync/async tag * Update tests * Fix issue with comparison * Fix small issues * Update integration test snapshots
#196) * Use service arg rather than service.name tag * Refactor inferred span metadata tags
* Additional attributes for sqs spans * Add additional attributes for sns * Add event subscription arn for sns * Add additional attributes for kinesis spans * Add additional attributes for dynamodb spans * Add additional attributes for s3 spans * Additional attribute for eventbridge spans * Add additional attributes for websocket spans * Fix websocket resource name * Additional attributes for apigateway v1 spans * Additional attributes for api-gateway v2 spans * Fix api-gateway v1 resource name * Fix merge issue * Add space to resource name * Update tests * black * Add typing_extensions to pyproject.toml * Update snapshots * Fix snapshots Co-authored-by: chris.agocs <chris.agocs@datadoghq.com>
* Extract trace context from sns payload * Fix extractor issue * Handle SNS message inside SQS event * Add extractor for Eventbridge context (#202) * Update expected breaking change date (#114) * change inferred_span to _inferred_span * Add extractor for eventbridge trace context * Add another test to test eventbridge extraction * Get tracing.Literal for pythons that don't have it already * Add _datadog to eventbridge extractor * Update integration tests * Remove init complete and main start logs Co-authored-by: Jorie Helwig <jorie.helwig@datadoghq.com> Co-authored-by: Harvinder Ghotra <ghotra.harvinder@gmail.com> * Remove duplicate entry * Kinesis extractor plus small fixes * Add snapshots * Add tests Co-authored-by: Christopher Agocs <agocs@users.noreply.github.com> Co-authored-by: Jorie Helwig <jorie.helwig@datadoghq.com>
For the integration test failures, for now you can add this line to fix them: |
) | ||
dt_format = "%Y-%m-%dT%H:%M:%SZ" | ||
timestamp = event["time"] | ||
dt = datetime.strptime(timestamp, dt_format) |
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 wish we had millisecond resolution here, but this will have to do for now
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.
Yeah, we need a figure out a solution for this and potentially other spans down the road with a similar issue.
What does this PR do?
Inferred Spans for the following AWS Managed Services:
Motivation
Testing Guidelines
Unit Tests:
poetry run nose2
Integration Tests:
BUILD_LAYERS=true UPDATE_SNAPSHOTS=true DD_API_KEY=<api_key> aws-vault exec sandbox-account-admin -- ./scripts/run_integration_tests.sh
Additional Notes
Types of Changes
Check all that apply