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

fix(httplib): avoid tracing requests made by trace writers #6635

Merged
merged 3 commits into from
Aug 12, 2023

Conversation

gnufede
Copy link
Member

@gnufede gnufede commented Aug 10, 2023

Description

Avoids tracing http requests made by trace writers to datadog internal services (i.e. prevents the ci visibility writer from sending traced requests to internal services).

Motivation

  • Prevents tracing internals from being traced.
  • Resolves flakiness in the httplib test suite with the agentless ci visibility writer

Checklist

  • Change(s) are motivated and described in the PR description.
  • Testing strategy is described if automated tests are not included in the PR.
  • Risk is outlined (performance impact, potential for breakage, maintainability, etc).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Library release note guidelines are followed. If no release note is required, add label changelog/no-changelog.
  • Documentation is included (in-code, generated user docs, public corp docs).
  • Backport labels are set (if applicable)

Reviewer Checklist

  • Title is accurate.
  • No unnecessary changes are introduced.
  • Description motivates each change.
  • Avoids breaking API changes unless absolutely necessary.
  • Testing strategy adequately addresses listed risk(s).
  • Change is maintainable (easy to change, telemetry, documentation).
  • Release note makes sense to a user of the library.
  • Reviewer has explicitly 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

@gnufede gnufede added changelog/no-changelog A changelog entry is not required for this PR. CI labels Aug 10, 2023
@gnufede gnufede marked this pull request as ready for review August 10, 2023 17:23
@gnufede gnufede requested review from a team as code owners August 10, 2023 17:23
Copy link
Contributor

@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.

This is no longer a ci fix. It's more of a bug fix or chore. We should update the PR title and add a release note (if required).

ddtrace/internal/writer/writer.py Outdated Show resolved Hide resolved
ddtrace/contrib/httplib/patch.py Show resolved Hide resolved
ddtrace/internal/writer/writer.py Outdated Show resolved Hide resolved
ddtrace/internal/writer/writer.py Outdated Show resolved Hide resolved
@pr-commenter
Copy link

pr-commenter bot commented Aug 10, 2023

Benchmarks

Benchmark execution time: 2023-08-11 21:03:45

Comparing candidate commit 25725d7 in PR branch gnufede/fix-httplib-flakyness with baseline commit f843f74 in branch 1.x.

Found 1 performance improvements and 3 performance regressions! Performance is the same for 90 metrics, 0 unstable metrics.

scenario:sethttpmeta-obfuscation-disabled

  • 🟩 max_rss_usage [-795.710KB; -649.359KB] or [-2.768%; -2.259%]

scenario:sethttpmeta-obfuscation-send-querystring-disabled

  • 🟥 max_rss_usage [+634.510KB; +812.197KB] or [+2.249%; +2.879%]

scenario:sethttpmeta-obfuscation-worst-case-implicit-query

  • 🟥 max_rss_usage [+619.745KB; +792.965KB] or [+2.196%; +2.810%]

scenario:span-start-finish

  • 🟥 max_rss_usage [+603.437KB; +752.749KB] or [+2.166%; +2.702%]

@emmettbutler emmettbutler removed their request for review August 11, 2023 13:45
@gnufede gnufede changed the title ci: fix httplib flakyness fix(httplib): avoid tracing tracer's requests Aug 11, 2023
@majorgreys
Copy link
Contributor

This might be a good use case for the pin object on a connection instance. wdyt?

@gnufede
Copy link
Member Author

gnufede commented Aug 11, 2023

This might be a good use case for the pin object on a connection instance. wdyt?

I tried that but didn't work for me, when disabled, it would disable the tracer for the whole integration, maybe further work is required for it to work as expected?

@mabdinur mabdinur force-pushed the gnufede/fix-httplib-flakyness branch 2 times, most recently from 389178f to 2923971 Compare August 11, 2023 16:45
@mabdinur mabdinur changed the title fix(httplib): avoid tracing tracer's requests fix(httplib): avoid tracing requests made by trace writers Aug 11, 2023
@mabdinur mabdinur force-pushed the gnufede/fix-httplib-flakyness branch from 838602a to ea79b93 Compare August 11, 2023 19:48
mabdinur
mabdinur previously approved these changes Aug 11, 2023
@mabdinur mabdinur enabled auto-merge (squash) August 11, 2023 19:48
@mabdinur mabdinur merged commit 193c554 into 1.x Aug 12, 2023
46 checks passed
@mabdinur mabdinur deleted the gnufede/fix-httplib-flakyness branch August 12, 2023 00:13
@github-actions github-actions bot added this to the v1.19.0 milestone Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog/no-changelog A changelog entry is not required for this PR. CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants