feat(logging): add log capture with native transport injection#7522
Draft
litianningdatadog wants to merge 1 commit intomasterfrom
Draft
feat(logging): add log capture with native transport injection#7522litianningdatadog wants to merge 1 commit intomasterfrom
litianningdatadog wants to merge 1 commit intomasterfrom
Conversation
Contributor
Overall package sizeSelf size: 4.64 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
|
BenchmarksBenchmark execution time: 2026-02-13 20:11:54 Comparing candidate commit 97d90fa in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 228 metrics, 32 unstable metrics. |
e4e9f4c to
fbc3011
Compare
Implements automatic log forwarding for Winston, Bunyan, and Pino by injecting native HTTP transports/streams directly into logger instances. Features: - Zero-configuration automatic injection via diagnostic channels - Native performance using logger-specific transports - Full trace correlation (trace_id, span_id, service, env, version) - Non-invasive (logs still go to original destinations) - Single intake endpoint with automatic format detection - Configurable batching and buffering Implementation: - Winston: Uses native winston.transports.Http - Bunyan: Custom Writable stream in object mode - Pino: Custom transport with NDJSON parsing Configuration: 9 new options (DD_LOG_CAPTURE_*) Performance: ~1.5-2μs per log overhead Package size: +33 KB (+0.13%) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
fbc3011 to
97d90fa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background:
The AWS Serverless team is exploring an approach that leverages dd-trace log injection to collect logs without depending on CloudWatch or the Log Forwarder. This would:
• Simplify the Datadog log ingestion setup
• Provide customers with potential cost savings
What does this PR do?
This PR implements native logger transport injection that automatically forwards application logs to a custom intake service by injecting HTTP transports/streams directly into Winston, Bunyan, and Pino loggers.
Implements automatic log forwarding for Winston, Bunyan, and Pino by injecting native HTTP transports/streams directly into logger instances.
Component Architecture

Key Features:
Implementation Approach:
Performance:
Test Coverage:
additions
Motivation
Business Value:
Why Native Transport Injection?
Use Cases: