Skip to content

Wire extended heartbeat interval through sidecar#3800

Draft
khanayan123 wants to merge 2 commits intomasterfrom
ayan.khan/wire-extended-heartbeat-sidecar
Draft

Wire extended heartbeat interval through sidecar#3800
khanayan123 wants to merge 2 commits intomasterfrom
ayan.khan/wire-extended-heartbeat-sidecar

Conversation

@khanayan123
Copy link
Copy Markdown
Contributor

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) <noreply@anthropic.com>
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) <noreply@anthropic.com>
@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.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: c038e78 | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or 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 <bob.weinand@datadoghq.com>
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.

1 participant