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

DEBUG-3568 DRY transport options, remove HTTP.new method #4469

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

p-datadog
Copy link
Member

@p-datadog p-datadog commented Mar 6, 2025

What does this PR do?

Reduces duplication of existing transport code by removing the HTTP.new method which was identical for all transports and removing the code that copied agent settings into transport options.

Transport options are now explicitly enumerated (they are api_version and headers) instead of being a hash. This will make code that passed invalid or unknown options fail instead of silently doing nothing.

Motivation:
Preparation for chunking of dynamic instrumentation event submissions

Change log entry
None

Additional Notes:
This PR should not contain any API changes. The options style arguments have been replaced with explicit keyword arguments in some methods but the set of arguments accepted remains the same as before.

How to test the change?
Existing unit tests

@p-datadog p-datadog requested review from a team as code owners March 6, 2025 19:39
@github-actions github-actions bot added core Involves Datadog core libraries tracing labels Mar 6, 2025
@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Mar 6, 2025

Datadog Report

Branch report: transport-options
Commit report: 0097941
Test service: dd-trace-rb

✅ 0 Failed, 20624 Passed, 1373 Skipped, 3m 17.49s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Mar 6, 2025

Benchmarks

Benchmark execution time: 2025-03-11 21:05:15

Comparing candidate commit 0097941 in PR branch transport-options with baseline commit 65b2901 in branch master.

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

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.70%. Comparing base (65b2901) to head (0097941).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4469   +/-   ##
=======================================
  Coverage   97.70%   97.70%           
=======================================
  Files        1379     1380    +1     
  Lines       83881    83813   -68     
  Branches     4251     4226   -25     
=======================================
- Hits        81953    81888   -65     
+ Misses       1928     1925    -3     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@p-datadog p-datadog changed the title DEBUG-3568 DRY transport code more DEBUG-3568 DRY transport options, remove HTTP.new method Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries tracing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants