Skip to content

DEBUG-3700 Remove duplicated classes from Telemetry transport #4575

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

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

p-datadog
Copy link
Member

@p-datadog p-datadog commented Apr 10, 2025

What does this PR do?

Removes duplicated Core classes from Telemetry transport code.

Motivation:
As part of getting telemetry working for dynamic instrumentation, telemetry needs to work with UDS which is what shopist uses. Currently Telemetry only supports HTTP. Using the Core transport code will bring UDS transport to Telemetry.

Change log entry

None

Additional Notes:

This is the first PR of a series. the next one will add a Core-based transport. This PR should be quick to review and conceptually it is standalone.

How to test the change?
Existing unit tests

@github-actions github-actions bot added the core Involves Datadog core libraries label Apr 10, 2025
Copy link

github-actions bot commented Apr 10, 2025

Thank you for updating Change log entry section 👏

Visited at: 2025-04-10 17:30:19 UTC

@datadog-datadog-prod-us1
Copy link
Contributor

datadog-datadog-prod-us1 bot commented Apr 10, 2025

Datadog Report

Branch report: telemetry-transport
Commit report: c2308a7
Test service: dd-trace-rb

✅ 0 Failed, 20790 Passed, 1370 Skipped, 3m 37.67s Total Time

@pr-commenter
Copy link

pr-commenter bot commented Apr 10, 2025

Benchmarks

Benchmark execution time: 2025-04-10 17:54:23

Comparing candidate commit b723f99 in PR branch telemetry-transport with baseline commit 7e2eeea in branch master.

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

scenario:profiler - stack collector

  • 🟩 throughput [+156.567op/s; +158.106op/s] or [+5.733%; +5.790%]

@p-datadog p-datadog changed the title Telemetry transport wip DEBUG-3700 Remove duplicated classes from Telemetry transport Apr 10, 2025
@p-datadog p-datadog force-pushed the telemetry-transport branch from f69c8e1 to b723f99 Compare April 10, 2025 17:30
@p-datadog p-datadog marked this pull request as ready for review April 10, 2025 17:30
@p-datadog p-datadog requested a review from a team as a code owner April 10, 2025 17:30
@@ -25,11 +26,11 @@ def request(event)
seq_id = self.class.sequence.next
payload = Request.build_payload(event, seq_id)
res = @http_transport.request(request_type: event.type, payload: payload.to_json)
Datadog.logger.debug { "Telemetry sent for event `#{event.type}` (code: #{res.code.inspect})" }
Datadog.logger.debug { "Telemetry sent for event `#{event.type}` (response: #{res})" }
Copy link
Member Author

Choose a reason for hiding this comment

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

The deleted telemetry code always returned nil for code, and code does not exist in the Core response class, therefore I changed reading of code to stringifying the response.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 97.73%. Comparing base (7e2eeea) to head (c2308a7).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4575      +/-   ##
==========================================
- Coverage   97.76%   97.73%   -0.03%     
==========================================
  Files        1405     1399       -6     
  Lines       86182    85903     -279     
  Branches     4357     4350       -7     
==========================================
- Hits        84258    83961     -297     
- Misses       1924     1942      +18     

☔ 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
Copy link
Member Author

datadog-ci-rb uses one of the removed clasess thusly:

          begin
            require "datadog/core/telemetry/http/adapters/net"

            # patch gem's telemetry transport layer to use Net::HTTP instead of WebMock's Net::HTTP
            Core::Telemetry::Http::Adapters::Net.include(CI::Transport::Adapters::TelemetryWebmockSafeAdapter)
          rescue => e
            Datadog.logger.warn("Failed to patch Datadog gem's telemetry layer: #{e}")
          end

LoadError is not derived from StandardError and will escape the rescue above.

I will put back the file with a dummy class definition.

@p-datadog p-datadog marked this pull request as draft April 11, 2025 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Involves Datadog core libraries
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants