Skip to content

[SLO] Add structured key/value labels to SLO definitions#272041

Draft
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:slo-metadata-support
Draft

[SLO] Add structured key/value labels to SLO definitions#272041
shahzad31 wants to merge 1 commit into
elastic:mainfrom
shahzad31:slo-metadata-support

Conversation

@shahzad31
Copy link
Copy Markdown
Contributor

Summary

Adds an optional labels field (Record<string, string>) to SLO definitions so users can enrich SLOs with business context (e.g. team, cost_center, product) and slice/filter by it.

The field is named labels (not metadata) to stay consistent with the ECS labels convention and the existing Synthetics monitor labels field, and it pairs naturally with the SLO tags array.

What's included (full vertical slice):

  • Schema (@kbn/slo-schema): new labelsSchema; labels added to the SLO definition and to the create/update route bodies (optional on input).
  • Saved object: labels flattened mapping + model version 2 (mappings_addition + data_backfill defaulting existing SLOs to {}).
  • ES resources: slo.labels flattened mapping in the SLI and summary component templates, and a set processor propagating slo.labels in the SLI and summary ingest pipelines. SLO_RESOURCES_VERSION bumped 3.63.7 to reinstall the updated resources.
  • UI: a key/value labels editor on the SLO edit form (Description section), labels badges on the SLO details Definition tab, and form ⇄ API conversion helpers. Editing labels is a non-breaking change (pipeline re-put, no revision bump).
  • Backward compatibility: labels is backfilled to {} in repository decode, remote summary doc decode, and composite member decode.

Closes #253243

Test plan

  • Unit/snapshot tests: full slo plugin Jest suite green (incl. new saved_objects/slo.test.ts model-version migration tests, update_slo non-breaking-change test, remote-summary decode, and form-helper conversions).
  • check_registered_types integration test updated for the new slo model version.
  • Manual: create an SLO with labels → verify they persist, render as badges on the Definition tab, propagate to slo.labels in the summary/SLI indices, survive edit (no revision bump) and clone.
  • API integration (Scout) coverage for create/update/get/find with labels — follow-up.

Note: branch name is slo-metadata-support (predates the rename to labels).

Made with Cursor

Adds an optional `labels` field (Record<string, string>) to SLO
definitions so users can enrich SLOs with business context (e.g. team,
cost_center, product). Aligns with the ECS `labels` convention and the
existing Synthetics monitor `labels` field.

- Schema: new `labelsSchema`; `labels` added to the SLO definition and
  the create/update route bodies.
- Saved object: `labels` flattened mapping + model version 2
  (mappings_addition + data_backfill defaulting to `{}`).
- ES resources: `slo.labels` flattened mapping in SLI/summary component
  templates and a `set` processor in the SLI/summary ingest pipelines;
  SLO_RESOURCES_VERSION bumped to 3.7.
- UI: key/value labels editor on the SLO edit form, labels badges on the
  SLO details Definition tab, and form <-> API conversion helpers.
- Backfills `labels` to `{}` across repository decode, remote summary
  docs, and composite member decode for backward compatibility.

Co-authored-by: Cursor <cursoragent@cursor.com>
@shahzad31 shahzad31 added backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. labels May 31, 2026
@github-actions github-actions Bot added the author:actionable-obs PRs authored by the actionable obs team label May 31, 2026
@infra-vault-gh-plugin-prod
Copy link
Copy Markdown

🤖 Jobs for this PR can be triggered through checkboxes. 🚧

ℹ️ To trigger the CI, please tick the checkbox below 👇

  • Click to trigger kibana-pull-request for this PR!
  • Click to trigger kibana-deploy-project-from-pr for this PR!
  • Click to trigger kibana-deploy-cloud-from-pr for this PR!
  • Click to trigger kibana-entity-store-performance-from-pr for this PR!
  • Click to trigger kibana-storybooks-from-pr for this PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:actionable-obs PRs authored by the actionable obs team backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SLO] Add structured key/value metadata support for SLO definitions

1 participant