Skip to content

Conversation

@erickhun
Copy link
Collaborator

@erickhun erickhun commented Nov 5, 2025

Summary by CodeRabbit

  • Chores

    • Bumped package version to 0.4.0
    • Updated datadog/dd-trace dependency to ^1.13.0
  • Refactor

    • Enhanced tracing detection and integration in logging

@erickhun erickhun requested a review from a team as a code owner November 5, 2025 08:24
@coderabbitai
Copy link

coderabbitai bot commented Nov 5, 2025

📝 Walkthrough

Walkthrough

The changes bump the package version to 0.4.0, update the datadog/dd-trace dependency to ^1.13.0, and refactor tracer integration in BuffLog to use function-based runtime checks instead of GlobalTracer detection for injecting tracing data.

Changes

Cohort / File(s) Summary
Version and Dependency Updates
composer.json
Version bumped from 0.3.3 to 0.4.0. datadog/dd-trace dependency updated from 0.82.* to ^1.13.0.
Tracer Integration Refactoring
src/BuffLog/BuffLog.php
Replaced GlobalTracer class detection with runtime function_exists checks for DDTrace functions. Updated tracing data injection to use DDTrace correlation functions and attach trace data to record->extra['dd']. Removed GlobalTracer state tracking. Updated warning messages to reference missing DDTrace functions. No public API changes.

Pre-merge checks and finishing touches

✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'upgrade calls to dd-trace library' accurately reflects the main changes in the pull request, which involve upgrading the dd-trace dependency and refactoring the tracing integration logic.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch upgrade

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

Disabled knowledge base sources:

  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5a63fde and e72a778.

📒 Files selected for processing (2)
  • composer.json (1 hunks)
  • src/BuffLog/BuffLog.php (2 hunks)
🔇 Additional comments (4)
composer.json (2)

4-4: LGTM: Version bump is appropriate.

The minor version increment from 0.3.3 to 0.4.0 is suitable for the backward-compatible API changes in this PR.


11-11: Version 1.13.0 verified as stable with no known security vulnerabilities.

dd-trace-php v1.13.0 was released on 2025-09-30 with performance/bug fixes and profiler additions. No public security advisory or CVE is tied to v1.13.0. The upgrade from 0.82.* to ^1.13.0 is safe to proceed.

src/BuffLog/BuffLog.php (2)

41-52: DDTrace functions verified and implementation is correct.

The function names and implementation pattern are confirmed in the official Datadog PHP tracer documentation. Both \DDTrace\logs_correlation_trace_id() and \dd_trace_peek_span_id() are available in version 1.13.0, and the usage pattern of storing trace data in extra['dd'] aligns with Datadog's recommended approach for log-trace correlation.


87-92: Namespace difference is intentional—code follows the documented DataDog pattern.

Both functions are part of dd-trace-php's documented API for log-trace correlation: \DDTrace\logs_correlation_trace_id() and procedural dd_trace_peek_span_id(). The code implementation matches the recommended Monolog processor pattern from DataDog documentation, and the placement in $record->extra['dd'] is designed for JSON log ingestion with proper path mapping in Datadog. No changes needed.


Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants