reporter: ship per-assertion metrics to Datadog staging - #147
Draft
r1viollet wants to merge 1 commit into
Draft
Conversation
Adds a new `reporter/` package and wires it into the analysis pipeline so each scenario run can emit: - prof_correctness.assertion.error_pct (distribution) - prof_correctness.assertion.passed / .total (count) - prof_correctness.scenario.failed / .total (count) - prof_correctness.scenario.duration_seconds (gauge) Tags are intentionally low-cardinality (scenario, language, profile_type, assertion_kind, runner_label, git_repo, git_branch). High-cardinality context (git_sha, ci_run_id, individual stack regexes) is left to CI Visibility — putting it on metric tags would blow up the custom-metric billing budget. The existing AnalyzeResults signature is preserved (the GitHub Action in analyze/ keeps working as-is); a new AnalyzeResultsWithOpts takes a MetricsSink + scenario/language tags. Default behaviour is unchanged: the recorder is only activated when DD_PROF_CORRECTNESS_REPORT is set, which the workflow gates to push@main and the nightly schedule. PR runs and local runs stay silent. Submits to datad0g.com (staging) so CI metrics don't pollute the prod Datadog account.
|
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.
What
Adds a new `reporter/` package and wires it into the analysis pipeline so each scenario run can emit metrics to Datadog staging (`datad0g.com`):
Tags (low-cardinality on purpose): `scenario`, `language`, `profile_type`, `assertion_kind`, `runner_label`, `git_repo`, `git_branch`. No `git_sha` / no `stack_regex` / no `ci_run_id` — that context lives in CI Visibility. Putting it on metric tags would blow up the custom-metric budget.
How
Activation
The recorder is default-off. It only emits when `DD_PROF_CORRECTNESS_REPORT=1` AND `DD_API_KEY_STAGING` is set. Local `go test` runs and PR CI runs send nothing.
Pre-requisite
`DD_API_KEY_STAGING` repo secret must be provisioned (in progress at PR open time).
Tests
```
ok github.com/DataDog/prof-correctness/analysis 0.5s
ok github.com/DataDog/prof-correctness/reporter 0.7s
ok github.com/DataDog/prof-correctness/cmd/... 1.2s
```
New test `TestPublicAPI_MetricsSink_EmitsPerAssertion` confirms the sink is called once per assertion with the right scenario/language/profile_type/kind/passed values. New `reporter` tests cover HTTP submission shape, tag grouping, and the no-op path.