-
Notifications
You must be signed in to change notification settings - Fork 2
[SDTEST-3873] Add extended telemetry #117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
anmarchenko
merged 13 commits into
main
from
anmarchenko/add-test-suite-durations-telemetry
Aug 10, 2026
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
074803c
Add test suite durations telemetry
anmarchenko e9f40a4
Report empty skippable responses
anmarchenko 9ad2bc2
Report CLI command telemetry
anmarchenko a8a7c87
Tag CLI telemetry with configuration
anmarchenko 4be95e3
Prevent rate limit duration overflow
anmarchenko ae4483f
Report CLI error codes
anmarchenko 1ec3708
Report test discovery telemetry
anmarchenko 462e7d3
Add planning decision telemetry
anmarchenko 2d547b4
Prefix DDTest telemetry metrics
anmarchenko 5fc8f11
Revert "Prefix DDTest telemetry metrics"
anmarchenko fb0e6d3
Prefix new DDTest telemetry metrics
anmarchenko 88821f8
Bound CLI telemetry tag cardinality
anmarchenko d5b9f05
Address telemetry review feedback
anmarchenko File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # DDTest error codes | ||
|
|
||
| Fatal `ddtest plan` and `ddtest run` errors include a stable error code in the | ||
| form `[error_code] error message`. The same value is reported by the | ||
| `error_code` tag on the `ddtest.cli.command` and `ddtest.cli.command_ms` | ||
| telemetry metrics. | ||
|
|
||
| Error codes identify the actionable failure point while the rest of the error | ||
| message and its wrapped Go error retain the specific OS, platform, framework, | ||
| or API cause. Existing codes must not be reused for a different condition. | ||
|
|
||
| ## Special telemetry values | ||
|
|
||
| | Code | Meaning | | ||
| | --- | --- | | ||
| | `none` | The command completed successfully. | | ||
| | `unknown` | An error from an external or injected implementation did not contain a DDTest error code. Production plan and run failure paths should not use this value. | | ||
|
|
||
| ## Planning errors | ||
|
|
||
| | Code | Condition | | ||
| | --- | --- | | ||
| | `plan_git_unavailable` | Git was not installed or could not be found before planning. | | ||
| | `plan_platform_detection_failed` | The configured platform could not be selected or did not pass its sanity check. | | ||
| | `plan_platform_tags_creation_failed` | Runtime or operating-system tags could not be collected from the selected platform. | | ||
| | `plan_runtime_tags_invalid` | The `runtime-tags` override could not be parsed. | | ||
| | `plan_framework_detection_failed` | The configured test framework is not supported or could not be initialized for the selected platform. | | ||
| | `plan_optimization_client_creation_failed` | The Test Optimization client could not be created. | | ||
| | `plan_test_files_resolution_failed` | The test include/exclude patterns could not be resolved or the test-file scan failed. | | ||
| | `plan_optimization_client_initialization_failed` | The Test Optimization client failed during initialization. | | ||
| | `plan_full_test_discovery_failed` | Required full test discovery failed while strict discovery was enabled. | | ||
| | `plan_fast_test_discovery_failed` | Fast test-file discovery failed and no full-discovery result was available. | | ||
| | `plan_full_discovery_results_processing_failed` | Full-discovery results could not be matched to the configured test selection. | | ||
| | `plan_fast_discovery_results_processing_failed` | Fast-discovery results could not be matched to the configured test selection. | | ||
| | `plan_manifest_write_failed` | The Test Optimization manifest could not be written. | | ||
| | `plan_cache_write_failed` | The Test Optimization plan cache could not be stored. | | ||
| | `plan_test_files_write_failed` | The selected test-files artifact could not be written. | | ||
| | `plan_skippable_percentage_write_failed` | The skippable-percentage artifact could not be written. | | ||
| | `plan_parallel_runners_write_failed` | The parallel-runner-count artifact could not be written. | | ||
| | `plan_test_splits_write_failed` | Test split artifacts could not be created or written. | | ||
|
|
||
| ## Run errors | ||
|
|
||
| | Code | Condition | | ||
| | --- | --- | | ||
| | `run_git_unavailable` | Git was not installed or could not be found before running tests. | | ||
| | `run_planning_failed` | The automatic planning phase returned an unclassified error. A classified planning failure retains its more precise `plan_*` code. | | ||
| | `run_plan_status_check_failed` | DDTest could not check whether planning artifacts exist. | | ||
| | `run_plan_load_failed` | The Test Optimization plan cache could not be loaded. | | ||
| | `run_parallel_runners_read_failed` | The parallel-runner-count artifact could not be read. | | ||
| | `run_parallel_runners_parse_failed` | The parallel-runner-count artifact did not contain a valid integer. | | ||
| | `run_platform_detection_failed` | The configured platform could not be selected or did not pass its sanity check before running tests. | | ||
| | `run_framework_detection_failed` | The configured test framework is not supported or could not be initialized before running tests. | | ||
| | `run_sequential_test_files_read_failed` | The sequential test-files artifact could not be read. | | ||
| | `run_sequential_tests_failed` | The test framework failed while running the sequential test batch. | | ||
| | `run_parallel_splits_read_failed` | The test-splits directory could not be read. | | ||
| | `run_parallel_test_files_read_failed` | A test split file could not be read. | | ||
| | `run_parallel_tests_failed` | The test framework failed in a local parallel worker. | | ||
| | `run_ci_node_test_files_missing` | The requested CI-node split file does not exist. | | ||
| | `run_ci_node_test_files_read_failed` | The requested CI-node split file could not be read. | | ||
| | `run_ci_node_tests_failed` | The test framework failed in a CI-node worker. | |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # DDTest telemetry metrics | ||
|
|
||
| This document tracks DDTest-specific metrics that must be added to the | ||
| [`civisibility` namespace in `common_metrics.json`](https://github.com/DataDog/dd-go/blob/prod/trace/apps/tracer-telemetry-intake/telemetry-metrics/static/common_metrics.json). | ||
| The names below are the metric names emitted in telemetry payloads; the intake | ||
| adds the `dd.instrumentation_telemetry_data.civisibility.` prefix. All metrics | ||
| are common metrics and are not sent to customer organizations. | ||
|
|
||
| ## Pending allowlist additions | ||
|
|
||
| | Metric | Type | Data type | Allowed tags | Description | | ||
| | --- | --- | --- | --- | --- | | ||
| | `ddtest.cli.command` | count | command | `command`, `exit_code`, `error_code`, `platform`, `framework`, `test_skipping_mode` | Number of completed top-level ddtest commands. `command` is `plan` or `run`; `exit_code` is `0` or `1`; `error_code` is a value from the [DDTest error code catalog](error-codes.md); the remaining tags contain the resolved CLI configuration. | | ||
| | `ddtest.cli.command_ms` | distribution | milliseconds | `command`, `exit_code`, `error_code`, `platform`, `framework`, `test_skipping_mode` | Duration of a top-level ddtest command, tagged by command, exit code, error code, and resolved CLI configuration. | | ||
| | `ddtest.itr_skippable_tests.is_empty` | count | responses | None | Number of successful skippable-tests fetches that returned zero skippable tests or suites. | | ||
| | `ddtest.planning.decision` | count | plans | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled`, `reason`, `target_status` | Number of completed plans. `reason` explains the constraint that selected the parallel runner split; `target_status` is `disabled`, `met`, or `missed`. | | ||
| | `ddtest.planning.test_files` | distribution | test files | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled`, `state` | Number of test files at each planning stage. `state` is `discovered`, `runnable`, or `fully_skipped`. | | ||
| | `ddtest.planning.estimated_time_saved_pct` | distribution | percentage | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Estimated percentage of test runtime saved by skipping decisions. | | ||
| | `ddtest.planning.test_file_durations` | distribution | test files | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled`, `source` | Number of runnable test files weighted using `backend` durations or `default` estimates. | | ||
| | `ddtest.planning.parallel_runners` | distribution | runners | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Number of parallel runners selected by the planner. | | ||
| | `ddtest.planning.expected_full_runtime_ms` | distribution | milliseconds | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Estimated serial runtime of all discovered test files before skipping. | | ||
| | `ddtest.planning.expected_runnable_runtime_ms` | distribution | milliseconds | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Estimated serial runtime after skipping decisions. | | ||
| | `ddtest.planning.expected_wall_time_ms` | distribution | milliseconds | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Estimated wall time for the selected parallel runner split. | | ||
| | `ddtest.planning.split_imbalance_pct` | distribution | percentage | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Difference between the most- and least-loaded runners as a percentage of expected wall time. | | ||
| | `ddtest.planning.disabled_tests` | distribution | tests | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Number of Test Management-disabled tests applied during planning. | | ||
| | `ddtest.planning.forced_run_suites` | distribution | suites | `platform`, `framework`, `test_skipping_mode`, `discovery_mode`, `tia_enabled` | Number of otherwise-skippable suites kept runnable by an unskippable marker. | | ||
| | `ddtest.test_discovery.duration_ms` | distribution | milliseconds | `discovery_mode`, `success`, `platform`, `framework` | Duration of the discovery strategy selected by the planner. `discovery_mode` is `full` for test discovery or `fast` for test-file discovery; `success` reports whether that selected strategy completed successfully. | | ||
| | `ddtest.test_discovery.tests` | distribution | tests | `discovery_mode`, `success`, `platform`, `framework` | Number of tests returned by selected full test discovery. Emitted only with `discovery_mode:full`. | | ||
| | `ddtest.test_discovery.test_files` | distribution | test files | `discovery_mode`, `success`, `platform`, `framework` | Number of test files returned by selected fast test-file discovery. Emitted only with `discovery_mode:fast`. | | ||
| | `test_suite_durations.request` | count | requests | `rq_compressed` | Number of requests sent to the test suite durations endpoint, regardless of success. | | ||
| | `test_suite_durations.request_errors` | count | requests | `error_type`, `status_code` | Number of terminal test suite durations request errors. `status_code` is emitted only for 400, 401, 403, 404, 408, and 429 responses. | | ||
| | `test_suite_durations.request_ms` | distribution | milliseconds | None | Time to receive a terminal response from the test suite durations endpoint. | | ||
| | `test_suite_durations.response_bytes` | distribution | bytes | `rs_compressed` | Wire size of a response page from the test suite durations endpoint. | | ||
| | `test_suite_durations.response_suites` | distribution | suites | None | Total number of test suites returned across all response pages. | | ||
| | `test_suite_durations.is_empty` | count | responses | None | Number of successful test suite durations fetches that returned zero test suites. | | ||
|
|
||
| For `ddtest.cli.command` and `ddtest.cli.command_ms`, `platform`, `framework`, | ||
| and `test_skipping_mode` are reported as `unknown` until platform and framework | ||
| detection succeeds. The detected values are then used for the rest of the | ||
| command. Raw CLI configuration values are never used as telemetry tags. | ||
|
|
||
| ### Planning tag values | ||
|
|
||
| - `reason`: `no_runnable_tests`, `single_runner_only`, `lowest_score`, | ||
| `target_met_lowest_score`, `target_met_changed_selection`, or | ||
| `target_unreachable_lowest_wall_time`. | ||
| - `target_status`: `disabled`, `met`, or `missed`. | ||
| - `state`: `discovered`, `runnable`, or `fully_skipped`. | ||
| - `source`: `backend` or `default`. | ||
| - `tia_enabled`: `true` or `false`, representing whether TIA skipping was | ||
| effective after applying backend settings and framework capabilities. |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.