Skip to content

feat(civisibility): add pagination metrics for known tests fetch#5024

Draft
calvinbayer wants to merge 1 commit into
mainfrom
add-known-tests-pagination-metrics
Draft

feat(civisibility): add pagination metrics for known tests fetch#5024
calvinbayer wants to merge 1 commit into
mainfrom
add-known-tests-pagination-metrics

Conversation

@calvinbayer

Copy link
Copy Markdown

What does this PR do?

Adds three new distribution metrics to track known tests (Early Flake Detection) pagination behavior:

  • civisibility.known_tests.pages_fetched - Number of pages fetched during pagination
  • civisibility.known_tests.total_fetch_ms - Wall-clock time from first to last page request
  • civisibility.known_tests.total_request_ms - Sum of individual per-page request durations

Motivation

Currently, only per-request timing is tracked. These new metrics provide observability into:

  • How often pagination occurs (single vs multi-page responses)
  • Backend pagination performance (total wall-clock time)
  • Network overhead vs local processing time (total_fetch_ms vs total_request_ms)

Implementation Details

  • Added telemetry helper functions to telemetry_distribution.go
  • Updated FetchKnownTests in known_tests_api.go to track timing
  • Manually registered metrics in known_metrics.common.go (expected warnings during testing)
  • Metrics are emitted only on successful completion after all pages are fetched

Testing

  • All known_tests tests pass (6 tests)
  • Expected warnings about metrics not being "known metrics" - these are informational and don't affect functionality
  • Code formatted with gofmt

Checklist

  • Tests passing (6 known_tests tests)
  • Code formatted (gofmt)
  • Backward compatible (no breaking changes)
  • Follows existing telemetry patterns
  • Metrics manually registered

@datadog-datadog-prod-us1-2

datadog-datadog-prod-us1-2 Bot commented Jul 13, 2026

Copy link
Copy Markdown

Pipelines  Tests

Fix all issues with BitsAI

⚠️ Warnings

🚦 12 Pipeline jobs failed

Pull Request Tests | multios-unit-tests (macos-latest, 1.26) / test-multi-os   View in Datadog   GitHub Actions

Pull Request Tests | multios-unit-tests (ubuntu-latest, 1.25) / test-multi-os   View in Datadog   GitHub Actions

Pull Request Tests | multios-unit-tests (macos-latest, 1.25) / test-multi-os   View in Datadog   GitHub Actions

View all 12 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🔄 Datadog auto-retried 2 jobs - 0 passed on retry View in Datadog

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 62.02% (-4.45%)

Useful? React with 👍 / 👎

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

Add three new distribution metrics to track known tests pagination:
- civisibility.known_tests.pages_fetched - number of pages fetched
- civisibility.known_tests.total_fetch_ms - wall-clock time for entire fetch
- civisibility.known_tests.total_request_ms - sum of per-page request times

Metrics are emitted only on successful completion of pagination.

Changes:
- Added telemetry helper functions in telemetry_distribution.go
- Updated FetchKnownTests to track timing and emit metrics
- Manually registered metrics in known_metrics.common.go

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@calvinbayer calvinbayer force-pushed the add-known-tests-pagination-metrics branch from ab281d7 to 04be4fa Compare July 13, 2026 11:45
@pr-commenter

pr-commenter Bot commented Jul 13, 2026

Copy link
Copy Markdown

Benchmarks

Benchmark execution time: 2026-07-13 12:16:20

Comparing candidate commit 04be4fa in PR branch add-known-tests-pagination-metrics with baseline commit 9ffdd0f in branch main.

Found 0 performance improvements and 0 performance regressions! Performance is the same for 326 metrics, 0 unstable metrics, 1 flaky benchmarks without significant changes.

Explanation

This is an A/B test comparing a candidate commit's performance against that of a baseline commit. Performance changes are noted in the tables below as:

  • 🟩 = significantly better candidate vs. baseline
  • 🟥 = significantly worse candidate vs. baseline

We compute a confidence interval (CI) over the relative difference of means between metrics from the candidate and baseline commits, considering the baseline as the reference.

If the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD), the change is considered significant.

Feel free to reach out to #apm-benchmarking-platform on Slack if you have any questions.

More details about the CI and significant changes

You can imagine this CI as a range of values that is likely to contain the true difference of means between the candidate and baseline commits.

CIs of the difference of means are often centered around 0%, because often changes are not that big:

---------------------------------(------|---^--------)-------------------------------->
                              -0.6%    0%  0.3%     +1.2%
                                 |          |        |
         lower bound of the CI --'          |        |
sample mean (center of the CI) -------------'        |
         upper bound of the CI ----------------------'

As described above, a change is considered significant if the CI is entirely outside the configured SIGNIFICANT_IMPACT_THRESHOLD (or the deprecated UNCONFIDENCE_THRESHOLD).

For instance, for an execution time metric, this confidence interval indicates a significantly worse performance:

----------------------------------------|---------|---(---------^---------)---------->
                                       0%        1%  1.3%      2.2%      3.1%
                                                  |   |         |         |
       significant impact threshold --------------'   |         |         |
                      lower bound of CI --------------'         |         |
       sample mean (center of the CI) --------------------------'         |
                      upper bound of CI ----------------------------------'

Known flaky benchmarks

These benchmarks are marked as flaky and will not trigger a failure. Modify FLAKY_BENCHMARKS_REGEX to control which benchmarks are marked as flaky.

Known flaky benchmarks without significant changes:

  • scenario:BenchmarkOTLPTraceWriterFlush

@calvinbayer calvinbayer changed the title Add pagination metrics for known tests fetch feat(civisibility): add pagination metrics for known tests fetch Jul 13, 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.

1 participant