Skip to content

OBSL-1025: emit metrics[] in scan-results payload when measurements present#2774

Draft
mivds wants to merge 4 commits into
obsl-1013-discovery-ship-tablecolumn-discovery-in-soda-corefrom
obsl-1025-extend-payload-builder-with-metrics-field
Draft

OBSL-1025: emit metrics[] in scan-results payload when measurements present#2774
mivds wants to merge 4 commits into
obsl-1013-discovery-ship-tablecolumn-discovery-in-soda-corefrom
obsl-1025-extend-payload-builder-with-metrics-field

Conversation

@mivds

@mivds mivds commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Extends v4's _build_check_collection_results_json_dict to emit a top-level metrics: [...] array — the prerequisite for metric monitoring (OBSL-1008 / OBSL-1024) to send measurements.

  • Adds an optional measurement_dicts: list[dict] field to CheckCollectionResult (defaults empty; distinct from the engine-internal measurements: list[Measurement]). MM callers populate it; contracts leave it empty.
  • The builder collects measurement dicts across results and adds payload["metrics"] only when at least one is present.
  • Byte-identical for contracts: when there are no measurements the "metrics" key is absent entirely (not null, not []), so existing contract payloads are unchanged.

Stacked on #2773 (OBSL-1013). Review/merge that first; this branch targets it.

Test Plan

  • Unit: contracts-only payload omits the metrics key; measurements present → metrics: [...] populated
  • Regression: full unit suite (986) passes; pre-commit (isort/black/autoflake) clean
  • MM tickets (OBSL-1008/1024) will populate measurement_dicts with v3 metric.get_cloud_dict()-shaped dicts

🤖 Generated with Claude Code

… present (OBSL-1025)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mivds added 2 commits July 1, 2026 23:30
…core' into obsl-1025-extend-payload-builder-with-metrics-field
…core' into obsl-1025-extend-payload-builder-with-metrics-field
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

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