-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(slo): allow configuration of advanced settings from UI #200822
Conversation
0c6c303
to
e3011a8
Compare
@@ -42,7 +42,7 @@ export class ApmTransactionDurationTransformGenerator extends TransformGenerator | |||
this.buildDestination(slo), | |||
this.buildGroupBy(slo, slo.indicator), | |||
this.buildAggregations(slo, slo.indicator), | |||
this.buildSettings(slo), | |||
this.buildSettings(slo, '@timestamp'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
APM always uses @timestamp
settings: merge( | ||
{ preventInitialBackfill: false, syncDelay: '1m', frequency: '1m' }, | ||
storedSLO.settings | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
merge()
simplifies the backward compatibility management of the settings
settings: merge( | ||
{ | ||
syncDelay: new Duration(1, DurationUnit.Minute), | ||
frequency: new Duration(1, DurationUnit.Minute), | ||
preventInitialBackfill: false, | ||
}, | ||
params.settings | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We set default values, and override with the provided values
: undefined | ||
} | ||
/> | ||
<SloEditForm onSave={onClose} initialValues={initialValues} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let the Form handles the merging of the provided values with default values
'xpack.slo.sloEdit.sliType.timesliceMetric.deleteLabel', | ||
{ defaultMessage: 'Delete metric' } | ||
)} | ||
<EuiFlexGroup direction="column" gutterSize="xs"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🖌️ Mostly UI change
|
||
export const getDataViewPattern = ({ | ||
export const getDataViewPatternOrId = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name was confusing me
const updateDataViewDependantFields = (indexPattern?: string, timestampField?: string) => { | ||
setValue(INDEX_FIELD, indexPattern ?? ''); | ||
setValue(INDICATOR_TIMESTAMP_FIELD, timestampField ?? ''); | ||
setValue(GROUP_BY_FIELD, ALL_VALUE); | ||
setValue(SETTINGS_SYNC_FIELD, null); | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We make sure to reset the data views dependant fields to avoid keeping non-existant values
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
💚 Build Succeeded
Metrics [docs]Module Count
Async chunks
Public APIs missing exports
Page load bundle
History
cc @kdelemme |
Starting backport for target branches: 8.x |
💔 All backports failed
Manual backportTo create the backport manually run:
Questions ?Please refer to the Backport tool documentation |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
1 similar comment
Friendly reminder: Looks like this PR hasn’t been backported yet. |
Friendly reminder: Looks like this PR hasn’t been backported yet. |
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
1 similar comment
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
Looks like this PR has a backport PR but it still hasn't been merged. Please merge it ASAP to keep the branches relatively in sync. |
…00822) (#203575) # Backport This will backport the following commits from `main` to `8.x`: - [feat(slo): allow configuration of advanced settings from UI (#200822)](#200822) <!--- Backport version: 8.9.8 --> ### Questions ? Please refer to the [Backport tool documentation](https://github.com/sqren/backport) <!--BACKPORT [{"author":{"name":"Kevin Delemme","email":"[email protected]"},"sourceCommit":{"committedDate":"2024-12-02T21:19:17Z","message":"feat(slo): allow configuration of advanced settings from UI (#200822)","sha":"8fe4c4419222f346bb6c953ca97422bd977e12f7","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport missing","v9.0.0","release_note:feature","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.18.0"],"number":200822,"url":"https://github.com/elastic/kibana/pull/200822","mergeCommit":{"message":"feat(slo): allow configuration of advanced settings from UI (#200822)","sha":"8fe4c4419222f346bb6c953ca97422bd977e12f7"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","labelRegex":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/200822","number":200822,"mergeCommit":{"message":"feat(slo): allow configuration of advanced settings from UI (#200822)","sha":"8fe4c4419222f346bb6c953ca97422bd977e12f7"}},{"branch":"8.x","label":"v8.18.0","labelRegex":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT-->
Resolves #200041
🐎 Summary
This PR adds an advanced settings section at the end of the objective section in the SLO form. This section can be used to configure the following settings fields: syncField, syncDelay, frequency and preventInitialBackfill.
syncField is a new settings. The other fields were already defined at the API level.
Except for preventInitialBackfill, the other fields were not available on the form.
syncField is optional, therefore current usage of the create/update APIs won't break if this field is not specified. A null value is used to specifically unset the field when updating an SLO.
I've also taken the opportunity to close #194957 by fixing the
index
row label state when the form is invalid.Note
While implementing this feature, I've noticed some bugs in the form state when changing the DataView / selected index. The dependant fields like groupBy and the new syncField were not cleared from the previously selected values, but the UI was hidding them.
The form was keeping the previous selected fields in its state, while hiding them from the combobox selection. This could lead to subtle bugs where user would edit an existing SLO, changing the DataView and hitting save, thinking the groupBy/syncField were cleared.
I've fixed this in this PR as well.
🧬 Testing
Release Note