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(tracing): support listing headers in DD_TRACE_HEADER_TAGS without tag names #9589

Merged
merged 26 commits into from
Jul 25, 2024

Conversation

mabdinur
Copy link
Contributor

@mabdinur mabdinur commented Jun 18, 2024

This will align the implementation of DD_TRACE_HEADER_TAGS with the golang and java tracers.

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.

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

@datadog-dd-trace-py-rkomorn
Copy link

Datadog Report

Branch report: munir/update-header-tags
Commit report: da02228
Test service: dd-trace-py

❌ 62 Failed (0 Known Flaky), 144622 Passed, 31498 Skipped, 9h 40m 40.28s Total duration (1h 9m 45.04s time saved)

❌ Failed Tests (62)

This report shows up to 5 failed tests.

  • test_get_malformed - test_http.py - Details

    Expand for error
     assert 8 == 7
      +  where 8 = len({'host': 'fc7337c02ef1', 'language': 'python', 'mytagfoobar': 'mytagfoobar', 'profiler_version': '2.11.0.dev12+gda0222868', ...})
    
  • test_get_malformed - test_http.py - Details

    Expand for error
     assert 8 == 7
      +  where 8 = len({'host': '301b32856fee', 'language': 'python', 'mytagfoobar': 'mytagfoobar', 'profiler_version': '2.11.0.dev12+gda0222868', ...})
    
  • test_get_malformed - test_http.py - Details

    Expand for error
     assert 8 == 7
      +  where 8 = len({'host': '653e1f94fb3b', 'language': 'python', 'mytagfoobar': 'mytagfoobar', 'profiler_version': '2.11.0.dev12+gda0222868', ...})
    
  • test_get_malformed - test_http.py - Details

    Expand for error
     assert 8 == 7
      +  where 8 = len({'host': '7957ab02e76f', 'language': 'python', 'mytagfoobar': 'mytagfoobar', 'profiler_version': '2.11.0.dev12+gda0222868', ...})
    
  • test_get_malformed - test_http.py

docs/configuration.rst Outdated Show resolved Hide resolved
@mtoffl01
Copy link
Contributor

mtoffl01 commented Jun 20, 2024

Can you be sure to update this in the system tests as well? - https://github.com/DataDog/system-tests/blob/main/manifests/python.yml#L682

@mabdinur my link is outdated b/c the file changed, but it's the Test_HeaderTags_Short: missing_feature field

@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jul 3, 2024

Datadog Report

Branch report: munir/update-header-tags
Commit report: 5668fce
Test service: dd-trace-py

❌ 2 Failed (0 Known Flaky), 144910 Passed, 31463 Skipped, 8h 11m 1.3s Total duration (1h 52m 52.11s time saved)

❌ Failed Tests (2)

  • test_dd_tags_invalid - test_tracer.py - Details

    Expand for error
     Subprocess Test "python -m unittest tests.tracer.test_tracer.EnvTracerTestCase.test_dd_tags_invalid" Failed (exit code 1):
     F
     ======================================================================
     FAIL: test_dd_tags_invalid (tests.tracer.test_tracer.EnvTracerTestCase)
     ----------------------------------------------------------------------
     Traceback (most recent call last):
       File "/root/project/tests/tracer/test_tracer.py", line 987, in test_dd_tags_invalid
         assert self.tracer._tags.get("key3")
     AssertionError
     
     ...
    
  • test_hourglass_turn - test_utils.py - Details

    Expand for error
     assert 0.36190004800005227 < 0.3
      +  where 0.36190004800005227 = <bound method StopWatch.elapsed of <ddtrace.internal.utils.time.StopWatch object at 0x7efd682e1c70>>()
      +    where <bound method StopWatch.elapsed of <ddtrace.internal.utils.time.StopWatch object at 0x7efd682e1c70>> = <ddtrace.internal.utils.time.StopWatch object at 0x7efd682e1c70>.elapsed
    

@pr-commenter
Copy link

pr-commenter bot commented Jul 3, 2024

Benchmarks

Benchmark execution time: 2024-07-24 18:43:26

Comparing candidate commit 165c988 in PR branch munir/update-header-tags with baseline commit 2de06b2 in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 214 metrics, 2 unstable metrics.

docs/configuration.rst Outdated Show resolved Hide resolved
docs/configuration.rst Outdated Show resolved Hide resolved
@mabdinur mabdinur marked this pull request as ready for review July 5, 2024 16:15
@mabdinur mabdinur requested review from a team as code owners July 5, 2024 16:15
docs/configuration.rst Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Jul 5, 2024

Codecov Report

Attention: Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.

Project coverage is 10.54%. Comparing base (9cce458) to head (80aff99).

Files Patch % Lines
tests/tracer/test_trace_utils.py 0.00% 18 Missing ⚠️
ddtrace/internal/utils/formats.py 0.00% 3 Missing ⚠️
tests/tracer/test_tracer.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #9589       +/-   ##
===========================================
- Coverage   73.93%   10.54%   -63.39%     
===========================================
  Files        1402     1368       -34     
  Lines      130420   127993     -2427     
===========================================
- Hits        96426    13502    -82924     
- Misses      33994   114491    +80497     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

docs/configuration.rst Outdated Show resolved Hide resolved
ddtrace/contrib/trace_utils.py Outdated Show resolved Hide resolved
Copy link
Contributor Author

@mabdinur mabdinur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@mabdinur mabdinur disabled auto-merge July 8, 2024 18:01
@mabdinur mabdinur enabled auto-merge (squash) July 10, 2024 16:44
Copy link
Contributor

github-actions bot commented Jul 16, 2024

CODEOWNERS have been resolved as:

releasenotes/notes/list_dd_header_tags-f8a9ce1daa2a1cf6.yaml            @DataDog/apm-python
ddtrace/contrib/trace_utils.py                                          @DataDog/apm-core-python @DataDog/apm-idm-python
ddtrace/internal/utils/formats.py                                       @DataDog/apm-core-python
docs/configuration.rst                                                  @DataDog/apm-core-python
tests/internal/test_settings.py                                         @DataDog/apm-core-python
tests/tracer/test_trace_utils.py                                        @DataDog/apm-sdk-api-python
tests/tracer/test_tracer.py                                             @DataDog/apm-sdk-api-python
tests/tracer/test_utils.py                                              @DataDog/apm-sdk-api-python

@datadog-dd-trace-py-rkomorn
Copy link

datadog-dd-trace-py-rkomorn bot commented Jul 16, 2024

Datadog Report

Branch report: munir/update-header-tags
Commit report: 80aff99
Test service: dd-trace-py

✅ 0 Failed, 133542 Passed, 44232 Skipped, 6h 53m 9.08s Total duration (12m 3.16s time saved)

@datadog-datadog-prod-us1
Copy link
Contributor

Library Vulnerabilities

Critical badge  High badge  Medium badge

@mabdinur mabdinur requested a review from a team as a code owner July 22, 2024 20:45
@mabdinur mabdinur merged commit 3e1a49a into main Jul 25, 2024
218 of 223 checks passed
@mabdinur mabdinur deleted the munir/update-header-tags branch July 25, 2024 04:13
gnufede pushed a commit that referenced this pull request Jul 26, 2024
…t tag names (#9589)

This will align the implementation of DD_TRACE_HEADER_TAGS with the
golang and java tracers.

## Checklist

- [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`.

## Reviewer Checklist

- [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: erikayasuda <[email protected]>
Co-authored-by: kyle <[email protected]>
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.

7 participants