[SLO] Add structured key/value labels to SLO definitions#272041
Draft
shahzad31 wants to merge 1 commit into
Draft
[SLO] Add structured key/value labels to SLO definitions#272041shahzad31 wants to merge 1 commit into
shahzad31 wants to merge 1 commit into
Conversation
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>
|
🤖 Jobs for this PR can be triggered through checkboxes. 🚧
ℹ️ To trigger the CI, please tick the checkbox below 👇
|
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.
Summary
Adds an optional
labelsfield (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(notmetadata) to stay consistent with the ECSlabelsconvention and the existing Synthetics monitorlabelsfield, and it pairs naturally with the SLOtagsarray.What's included (full vertical slice):
@kbn/slo-schema): newlabelsSchema;labelsadded to the SLO definition and to the create/update route bodies (optional on input).labelsflattened mapping + model version2(mappings_addition+data_backfilldefaulting existing SLOs to{}).slo.labelsflattened mapping in the SLI and summary component templates, and asetprocessor propagatingslo.labelsin the SLI and summary ingest pipelines.SLO_RESOURCES_VERSIONbumped3.6→3.7to reinstall the updated resources.labelsis backfilled to{}in repository decode, remote summary doc decode, and composite member decode.Closes #253243
Test plan
sloplugin Jest suite green (incl. newsaved_objects/slo.test.tsmodel-version migration tests,update_slonon-breaking-change test, remote-summary decode, and form-helper conversions).check_registered_typesintegration test updated for the newslomodel version.slo.labelsin the summary/SLI indices, survive edit (no revision bump) and clone.Made with Cursor