Skip to content

Wire extended heartbeat interval through sidecar#3800

Merged
bwoebi merged 7 commits intomasterfrom
ayan.khan/wire-extended-heartbeat-sidecar
Apr 21, 2026
Merged

Wire extended heartbeat interval through sidecar#3800
bwoebi merged 7 commits intomasterfrom
ayan.khan/wire-extended-heartbeat-sidecar

Conversation

@khanayan123
Copy link
Copy Markdown
Contributor

@khanayan123 khanayan123 commented Apr 15, 2026

Description

The libdatadog telemetry worker already supports telemetry_extended_heartbeat_interval
in its Config (added in libdatadog PR #1824), but the sidecar's SessionConfig and
FFI layer did not expose it. This meant PHP (and any other sidecar consumer) could not
configure the extended heartbeat interval, preventing app-extended-heartbeat events
from being emitted at the desired cadence.

Changes:

  • libdatadog sidecar SessionConfig (datadog-sidecar/src/service/mod.rs):
    add telemetry_extended_heartbeat_interval: Duration field

  • libdatadog sidecar server (datadog-sidecar/src/service/sidecar_server.rs):
    propagate the new field into the telemetry Config inside modify_telemetry_config

  • libdatadog sidecar FFI (datadog-sidecar-ffi/src/lib.rs):
    add telemetry_extended_heartbeat_interval_millis: u64 parameter to
    ddog_sidecar_session_set_config and wire it into SessionConfig

  • PHP C header (components-rs/sidecar.h):
    update ddog_sidecar_session_set_config signature with the new parameter

  • PHP configuration (ext/configuration.h):
    add DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL config (default 86400 s = 24 hours),
    matching the default in libdd-telemetry

  • PHP sidecar call (ext/sidecar.c):
    pass DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL through the FFI call

Note: The libdatadog submodule is pointed at branch
ayan.khan/wire-extended-heartbeat-sidecar which contains the Rust-side changes.
A companion libdatadog PR will be needed to merge those changes to main first,
then the submodule pointer can be updated to the merged commit.

Reviewer checklist

  • Test coverage seems ok.
  • Appropriate labels assigned.

The libdatadog telemetry worker already supports
telemetry_extended_heartbeat_interval in its Config, but the sidecar's
SessionConfig and FFI layer did not expose it. This meant PHP (and any
other sidecar consumer) could not configure the extended heartbeat
interval, preventing app-extended-heartbeat events from being emitted
at the desired cadence.

Changes:
- libdatadog sidecar: add telemetry_extended_heartbeat_interval to
  SessionConfig and propagate it into the telemetry Config inside
  modify_telemetry_config
- libdatadog sidecar-ffi: add telemetry_extended_heartbeat_interval_millis
  parameter to ddog_sidecar_session_set_config
- PHP ext: add DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL config (default
  86400 s = 24 h) and pass it through the FFI call
- C header: update ddog_sidecar_session_set_config signature

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Add DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL entry to keep
metadata in sync with ext/configuration.h.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

datadog-datadog-prod-us1-2 Bot commented Apr 15, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 60.64% (+0.00%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 4438b5a | Docs | Datadog PR Page | Give us feedback!

@pr-commenter
Copy link
Copy Markdown

pr-commenter Bot commented Apr 15, 2026

Benchmarks [ tracer ]

Benchmark execution time: 2026-04-15 19:33:06

Comparing candidate commit c038e78 in PR branch ayan.khan/wire-extended-heartbeat-sidecar with baseline commit ad5a7e6 in branch master.

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

scenario:MessagePackSerializationBench/benchMessagePackSerialization-opcache

  • 🟩 execution_time [-5.931µs; -4.209µs] or [-5.504%; -3.906%]

scenario:PDOBench/benchPDOOverhead-opcache

  • 🟥 execution_time [+7.131µs; +9.381µs] or [+2.968%; +3.904%]

scenario:PDOBench/benchPDOOverheadWithDBM-opcache

  • 🟥 execution_time [+7.248µs; +9.276µs] or [+3.022%; +3.868%]

scenario:PHPRedisBench/benchRedisOverhead

  • 🟥 execution_time [+38.859µs; +50.949µs] or [+4.092%; +5.365%]

gh-worker-dd-mergequeue-cf854d Bot pushed a commit to DataDog/libdatadog that referenced this pull request Apr 17, 2026
…sionConfig (#1882)

## Summary

Add `telemetry_extended_heartbeat_interval` to the sidecar's `SessionConfig` and FFI
layer so that callers (e.g. PHP tracer) can configure the extended heartbeat interval.

The telemetry worker already supports this field in its `Config` struct, but the sidecar
was not passing it through from `SessionConfig` -> `modify_telemetry_config`. This meant
sidecar consumers could not control the cadence of `app-extended-heartbeat` events.

**Changes:**
- `datadog-sidecar/src/service/mod.rs`: add `telemetry_extended_heartbeat_interval: Duration` to `SessionConfig`
- `datadog-sidecar/src/service/sidecar_server.rs`: set `cfg.telemetry_extended_heartbeat_interval` in `modify_telemetry_config`
- `datadog-sidecar-ffi/src/lib.rs`: add `telemetry_extended_heartbeat_interval_millis: u64` param to `ddog_sidecar_session_set_config`

Companion dd-trace-php PR: DataDog/dd-trace-php#3800

Co-authored-by: bwoebi <[email protected]>
@bwoebi bwoebi force-pushed the ayan.khan/wire-extended-heartbeat-sidecar branch from 33003d7 to f2effff Compare April 21, 2026 12:54
PR DataDog/libdatadog#1882 (wire extended heartbeat interval through the
sidecar) has merged to main, so repoint the submodule from the feature
branch to c03245d4e on main.
@khanayan123 khanayan123 marked this pull request as ready for review April 21, 2026 14:25
@khanayan123 khanayan123 requested review from a team as code owners April 21, 2026 14:25
@khanayan123 khanayan123 requested a review from bwoebi April 21, 2026 14:26
@bwoebi bwoebi merged commit 3df62fd into master Apr 21, 2026
2088 of 2097 checks passed
@bwoebi bwoebi deleted the ayan.khan/wire-extended-heartbeat-sidecar branch April 21, 2026 16:22
@github-actions github-actions Bot added this to the 1.19.0 milestone Apr 21, 2026
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