feat(telemetry): add app-extended-heartbeat parametric tests#6338
Draft
khanayan123 wants to merge 28 commits intomainfrom
Draft
feat(telemetry): add app-extended-heartbeat parametric tests#6338khanayan123 wants to merge 28 commits intomainfrom
khanayan123 wants to merge 28 commits intomainfrom
Conversation
Add comprehensive parametric test suite for app-extended-heartbeat telemetry event across all SDK languages. Tests verify timing, payload structure, consistency, and compliance with API spec. Tests added: - test_extended_heartbeat_emission: Verifies interval timing - test_extended_heartbeat_sequence: Validates multiple events - test_extended_heartbeat_payload_content: Checks required fields - test_extended_heartbeat_matches_app_started: Ensures consistency - test_extended_heartbeat_excludes_products_and_install_signature - test_extended_heartbeat_default_interval: Validates 24h default All tests run parametrically across 9 SDK languages (Go, Java, .NET, C++, PHP, Ruby, Rust, Python, Node.js). Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Contributor
|
|
Register comprehensive parametric tests for app-extended-heartbeat event validation across all SDK languages. Tests verify: - Periodic emission timing (24h default, configurable) - Payload structure (config, deps, integrations) - Consistency with app-started event - Proper field exclusions (products, install_signature) Language version markers: - Go: v1.73.0-dev - Java: v1.40.0 - Node.js: v5.0.0 - Python: v2.0.0 - Ruby: v2.1.0-dev - C++: v0.2.0-dev - PHP: v1.0.0-dev - .NET: missing_feature (intentionally skipped - no forked runtime-id issues) Tests use fast intervals (0.3-0.5s) for CI efficiency. Test location: tests/parametric/test_telemetry.py::Test_ExtendedHeartbeat (lines 1256-1514) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Changed Test_ExtendedHeartbeat manifest entries from development version strings (e.g., v1.73.0-dev, v2.1.0-dev) to missing_feature to follow repository conventions. Development versions should not be specified in manifests. Tests for unreleased features should use missing_feature until the feature is actually released in a production version. Changes: - cpp.yml: v0.2.0-dev → missing_feature - golang.yml: v1.73.0-dev → missing_feature - nodejs.yml: '>=5.0.0' → missing_feature - php.yml: v1.0.0-dev → missing_feature - ruby.yml: v2.1.0-dev → missing_feature 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
…tionality Replace 6 complex test methods with a single simplified test that focuses on the core requirement: comparing configurations across telemetry events. The new test: - Grabs app-started, app-extended-heartbeat, and app-client-configuration-change events - Extracts configuration data from each - Asserts configs match between app-started and app-extended-heartbeat - Optionally validates config-change event configs match as well This reduces test complexity from ~260 lines to ~40 lines while maintaining coverage of the critical functionality. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Configure manifests to run app-extended-heartbeat tests only on Node.js for initial validation: - Enable Node.js: *ref_5_0_0 (>=5.0.0) - Disable Python: v2.0.0 -> missing_feature - Disable Java: v1.40.0 -> missing_feature - Keep all others disabled: missing_feature (cpp, dotnet, php, golang, ruby) This allows focused testing of Node.js implementation before enabling other languages. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
- Add SLF001 exception for test_telemetry.py to allow _get_telemetry_event usage - Fix nodejs.yml manifest to use '>=5.0.0' instead of non-existent anchor - All linting checks now pass (mypy, ruff, yamlfmt, yamllint, shellcheck) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
✨ Fix all issues with BitsAI or with Cursor
|
Java tracer supports configurable extended heartbeat interval via DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL, so enable the parametric tests.
Resolve merge conflicts in manifests/java.yml, manifests/ruby.yml, and tests/parametric/test_telemetry.py. Keep Test_ExtendedHeartbeat additions while incorporating main's telemetry key normalization and stable configuration origin updates. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Revert pyproject.toml changes (not needed for this PR) and remove DD_TELEMETRY_HEARTBEAT_INTERVAL from Test_ExtendedHeartbeat since we only need to configure the extended heartbeat interval. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Use integer interval (1s) for Java compatibility (getLong) - Assert configs as superset with value matching, order-agnostic - Build expected config from app-started + config-change overlay - Collect all config-change events, not just the last one Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 31, 2026
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
to DataDog/dd-trace-py
that referenced
this pull request
Mar 31, 2026
…eat payload (#17203) ## Summary Fix the extended heartbeat payload key from `"configurations"` (plural) to `"configuration"` (singular) to match the [telemetry v2 API spec](https://github.com/DataDog/instrumentation-telemetry-api-docs/blob/main/GeneratedDocumentation/ApiDocs/v2/SchemaDocumentation/Schemas/app_extended_heartbeat.md) and align with other SDKs (Java, .NET, Node.js). ## Changes - **`ddtrace/internal/telemetry/writer.py`**: `payload["configurations"]` → `payload["configuration"]` - **`tests/telemetry/test_telemetry.py`**: Updated test assertions to match ## Motivation Cross-SDK system tests validate that `app-extended-heartbeat` payloads use the same schema. The spec and all other SDKs use `"configuration"` (singular). This mismatch would cause system test & dropped telemetry payloads failures for Python. ## Related - System test PR: DataDog/system-tests#6338 - Original Python implementation: #16628 Co-authored-by: ayan.khan <ayan.khan@datadoghq.com>
Resolve merge conflict in manifests/ruby.yml (kept both Test_ExtendedHeartbeat and updated Test_Stable_Configuration_Origin). Fix ruff lint issues: D209 docstring closing quotes and SLF001 private member access noqa annotations in test_telemetry.py. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
cbeauchesne
reviewed
Apr 1, 2026
Collaborator
cbeauchesne
left a comment
There was a problem hiding this comment.
There is already test on heartbeats in DEFAULT scenario.
If you plan to test only one or two set of parameters, then the end-to-end DEFAULT scenario is a best fit from a quality POV as the coverage is by far more complete.
We can chat more about what are the good/bad use cases for parametric/end-to-end if you want, just ping me !
gh-worker-dd-mergequeue-cf854d bot
pushed a commit
to DataDog/libdatadog
that referenced
this pull request
Apr 1, 2026
…cheduler (#1824) ## Summary Wire up the `DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL` config value to the telemetry scheduler. The env var was already parsed into `config.telemetry_extended_heartbeat_interval` but the scheduler hardcoded `Duration::from_secs(60 * 60 * 24)` instead of using it. Default remains 24h this only enables system tests to use a shorter interval to validate the `app-extended-heartbeat` event fires correctly. ## Changes - **`libdd-telemetry/src/worker/mod.rs`**: Replace hardcoded `60 * 60 * 24` with `config.telemetry_extended_heartbeat_interval` ## Motivation Cross-SDK system tests need to set a short extended heartbeat interval (e.g., 2s) to validate parity of the `app-extended-heartbeat` telemetry event across all SDKs. Without this fix, PHP and other libdatadog consumers cannot be system-tested for this feature. ## Related - System test PR: DataDog/system-tests#6338 Co-authored-by: edmund.kump <edmund.kump@datadoghq.com>
Add Test_ExtendedHeartbeat to tests/test_telemetry.py for the DEFAULT scenario, validating that extended heartbeat config is a superset of app-started plus any config changes. Set DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL env var in weblog containers. Add manifest entries for all libraries. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL from base container env to the DEFAULT scenario weblog_env where it belongs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The extended heartbeat validation is better suited as an end-to-end test in the DEFAULT scenario where it exercises the full tracer stack. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Create TELEMETRY_EXTENDED_HEARTBEAT scenario to avoid interfering with existing heartbeat timing tests in DEFAULT. Remove extended heartbeat env vars from DEFAULT scenario. Mark nodejs as missing_feature since dd-trace-js does not expose DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL and tests it locally via unit tests. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Ensure the regular heartbeat interval is short enough so the extended heartbeat fires within the test window. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
dd-trace-cpp#301 implements app-extended-heartbeat and will ship in the next release (v2.1.0). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use ">2.0.0" instead of "v2.1.0" since dd-trace-cpp uses internal dev build versions between infrequent releases. The change from dd-trace-cpp#301 will be available in dev builds after v2.0.0. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove e2e entry from cpp.yml (parametric only, no parametric test). Add entries to cpp_nginx.yml (>1.14.0) and cpp_httpd.yml (>1.0.4) which use nginx-datadog and httpd-datadog versions respectively. dd-trace-cpp#301 will land in the next releases of these modules. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Relax the superset assertion to only validate that configs present in both app-started and app-extended-heartbeat have matching values. Some tracers may not track all configs in _sent_configs, so a strict superset check causes false failures. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…ogic" This reverts commit 1bfb4b8.
Use the last app-extended-heartbeat that appears after the last app-client-configuration-change in the telemetry stream. This ensures the heartbeat has had a chance to include all lazily registered configs (e.g. DD_LLMOBS_EVALUATOR_SAMPLING_RULES in Python which is registered during LLMObs.enable()). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
b0c8500 to
388375a
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.
Add comprehensive parametric test suite for app-extended-heartbeat telemetry event across all SDK languages. Tests verify timing, payload structure, consistency, and compliance with API spec.
All tests run parametrically across 9 SDK languages (Go, Java, .NET, C++, PHP, Ruby, Rust, Python, Node.js).
Motivation
Changes
Workflow
🚀 Once your PR is reviewed and the CI green, you can merge it!
🛟 #apm-shared-testing 🛟
Reviewer checklist
tests/ormanifests/is modified ? I have the approval from R&P teambuild-XXX-imagelabel is present