You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(startup-log): emit immediately after init and send to stderr (#7470)
* fix(startup-log): emit immediately after init and send to stderr
Startup logs now emit immediately after tracer initialization instead of
being delayed until the first payload is sent to the agent. They are also
sent to stderr (via console.error) instead of stdout, following Unix
conventions and aligning with other Datadog language tracers.
Changes:
- Added startupLog() call in proxy.js after initialization completes
- Changed output from info() to error() to use stderr
- Removed duplicate late call in writer.js that was firing on first payload
- Updated tests to expect console.error instead of console.info
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(tests): update data_streams_enabled tests to use console.error
After merging master, the new data_streams_enabled tests were still using
console.info instead of console.error. Updated all three tests in that
describe block to use console.error to match the stderr output change.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(startup-log): separate initialization and agent diagnostic logs
Previously, the startup log and agent connection diagnostic were coupled
together in a single call. This meant that if the startup log was emitted
immediately (as intended), we would lose the agent connection diagnostic
that happens on the first write attempt.
Changes:
- Split startupLog() into two separate functions:
- startupLog(): Logs tracer configuration immediately after init
- logAgentError(): Logs agent connection diagnostic on first write error
- Each function maintains its own "already ran" flag to log only once
- Updated writer.js to call logAgentError() when agent responds with error
- Updated tests to verify both logs are emitted correctly and separately
This ensures users get both the immediate startup configuration log AND
the agent connection diagnostic if there's an issue reaching the agent.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
* fix(startup-log): use warn for both startup log and agent diagnostic
Changed startup log to use warn() instead of error() for consistency.
Both the startup configuration log and agent diagnostic now use warn(),
which outputs to stderr via console.warn().
Changes:
- startup-log.js: Changed startupLog() to use warn() instead of error()
- Removed unused error import from log/writer
- Updated all tests to expect console.warn instead of console.error
This is more semantically appropriate since both logs are diagnostic
information rather than actual errors.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
0 commit comments