Skip to content
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

feat(datastreams): change DSM encoding to use base64 and decoding to … #8780

Closed
wants to merge 2 commits into from

Conversation

tabgok
Copy link
Contributor

@tabgok tabgok commented Mar 26, 2024

…handle multiple encoding types (#8611)

Makes DSM pathway encoding/decoding more resilient, also adds a DSMPathwayCodec class that handles encoding / decoding DSM context. This makes future changes easier, since all integrations will now use this class instead of the actual encoding / decoding methods.

Encode using base64 only

Try to decode the following:

  • base64,
  • deprecated encoding of bytes
  • base64 encoding sent using deprecated key

Co-authored-by: Munir Abdinur munir.abdinur@datadoghq.com
(cherry picked from commit 3dd4c9d)

Checklist

  • Change(s) are motivated and described in the PR description
  • Testing strategy is described if automated tests are not included in the PR
  • Risks are described (performance impact, potential for breakage, maintainability)
  • Change is maintainable (easy to change, telemetry, documentation)
  • Library release note guidelines are followed or label changelog/no-changelog is set
  • Documentation is included (in-code, generated user docs, public corp docs)
  • Backport labels are set (if applicable)
  • If this PR changes the public interface, I've notified @DataDog/apm-tees.
  • If change touches code that signs or publishes builds or packages, or handles credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.

Reviewer Checklist

  • Title is accurate
  • All changes are related to the pull request's stated goal
  • Description motivates each change
  • Avoids breaking API changes
  • Testing strategy adequately addresses listed risks
  • Change is maintainable (easy to change, telemetry, documentation)
  • Release note makes sense to a user of the library
  • Author has acknowledged and discussed the performance implications of this PR as reported in the benchmarks PR comment
  • Backport labels are set in a manner that is consistent with the release branch maintenance policy

…handle multiple encoding types (#8611)

Makes DSM pathway encoding/decoding more resilient, also adds a
`DSMPathwayCodec` class that handles encoding / decoding DSM context.
This makes future changes easier, since all integrations will now use
this class instead of the actual encoding / decoding methods.

Encode using base64 only

Try to decode the following:
-    base64,
-    deprecated encoding of bytes
-    base64 encoding sent using deprecated key

- [x] Change(s) are motivated and described in the PR description
- [x] Testing strategy is described if automated tests are not included
in the PR
- [x] Risks are described (performance impact, potential for breakage,
maintainability)
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] [Library release note
guidelines](https://ddtrace.readthedocs.io/en/stable/releasenotes.html)
are followed or label `changelog/no-changelog` is set
- [x] Documentation is included (in-code, generated user docs, [public
corp docs](https://github.com/DataDog/documentation/))
- [x] Backport labels are set (if
[applicable](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting))
- [x] If this PR changes the public interface, I've notified
`@DataDog/apm-tees`.
- [x] If change touches code that signs or publishes builds or packages,
or handles credentials of any kind, I've requested a review from
`@DataDog/security-design-and-guidance`.

- [x] Title is accurate
- [x] All changes are related to the pull request's stated goal
- [x] Description motivates each change
- [x] Avoids breaking
[API](https://ddtrace.readthedocs.io/en/stable/versioning.html#interfaces)
changes
- [x] Testing strategy adequately addresses listed risks
- [x] Change is maintainable (easy to change, telemetry, documentation)
- [x] Release note makes sense to a user of the library
- [x] Author has acknowledged and discussed the performance implications
of this PR as reported in the benchmarks PR comment
- [x] Backport labels are set in a manner that is consistent with the
[release branch maintenance
policy](https://ddtrace.readthedocs.io/en/latest/contributing.html#backporting)

---------

Co-authored-by: Munir Abdinur <munir.abdinur@datadoghq.com>
(cherry picked from commit 3dd4c9d)
@tabgok tabgok self-assigned this Mar 26, 2024
@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: backport-8611-to-2.7
Commit report: fd07efc
Test service: dd-trace-py

❌ 8 Failed (1 Known Flaky), 99718 Passed, 72404 Skipped, 7h 14m 48.91s Total duration (3h 58m 54.48s time saved)

❌ Failed Tests (8)

This report shows up to 5 failed tests.

  • test_kinesis_data_streams_enabled_put_record - test.py - ❄️ Known flaky - Details

    Expand for error
     Subprocess Test "python -m unittest tests.contrib.botocore.test.BotocoreTest.test_kinesis_data_streams_enabled_put_record" Failed
    
  • test_kinesis_data_streams_enabled_put_record - test.py - Details

    Expand for error
     Subprocess Test "python -m unittest tests.contrib.botocore.test.BotocoreTest.test_kinesis_data_streams_enabled_put_record" Failed
    
  • test_kinesis_data_streams_enabled_put_record - test.py - Details

    Expand for error
     Subprocess Test "python -m unittest tests.contrib.botocore.test.BotocoreTest.test_kinesis_data_streams_enabled_put_record" Failed
    
  • test_kinesis_data_streams_enabled_put_record - test.py - Details

    Expand for error
     Subprocess Test "python -m unittest tests.contrib.botocore.test.BotocoreTest.test_kinesis_data_streams_enabled_put_record" Failed
    
  • test_kinesis_data_streams_enabled_put_records - test.py

@pr-commenter
Copy link

pr-commenter bot commented Mar 26, 2024

Benchmarks

Benchmark execution time: 2024-03-26 20:06:12

Comparing candidate commit fd07efc in PR branch backport-8611-to-2.7 with baseline commit 1776fd0 in branch 2.7.

Found 4 performance improvements and 1 performance regressions! Performance is the same for 196 metrics, 9 unstable metrics.

scenario:httppropagationextract-empty_headers

  • 🟩 max_rss_usage [-781.574KB; -610.246KB] or [-3.577%; -2.793%]

scenario:httppropagationextract-medium_header_no_matches

  • 🟩 max_rss_usage [-742.031KB; -491.275KB] or [-3.390%; -2.244%]

scenario:httppropagationextract-wsgi_large_header_no_matches

  • 🟩 max_rss_usage [-782.350KB; -543.116KB] or [-3.578%; -2.484%]

scenario:httppropagationextract-wsgi_medium_header_no_matches

  • 🟩 max_rss_usage [-795.305KB; -630.513KB] or [-3.636%; -2.882%]

scenario:samplingrules-low_match

  • 🟥 execution_time [+9.738µs; +17.690µs] or [+2.138%; +3.884%]

@tabgok tabgok closed this Apr 1, 2024
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.

None yet

2 participants