-
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): SLO grouping values selector #202364
Conversation
} | ||
|
||
export function SLOGroupingValueSelector({ slo, groupingKey, value }: Props) { | ||
const isAvailable = window.location.pathname.includes(SLOS_BASE_PATH); |
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.
💬 This page can be displayed from the dashboard flyout, it's a little bit tricky to handle correctly so I've decided to disable the selection in this case.
sloId: string, | ||
params: GetSLOInstancesParams | ||
): Promise<GetSLOInstancesResponse> { | ||
const { slo } = await this.definitionClient.execute(sloId, this.spaceId, params?.remoteName); |
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.
Fetch from the remote cluster if provided, otherwise it uses the repository
Pinging @elastic/obs-ux-management-team (Team:obs-ux-management) |
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
e6805a6
to
6d04e55
Compare
throw new Error(`Something went wrong. Error: ${error}`); | ||
} | ||
}, | ||
enabled: Boolean(!!sloId && !!groupingKey && instanceId !== ALL_VALUE), |
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.
💬 Technically the SLOGroupings component should never call this hook without these values, but in order to prevent other misusage, i'm adding this explicitly
...groupingKeyValuePairs | ||
.filter(([groupingKey]) => groupingKey !== params.groupingKey) | ||
.map(([groupingKey, groupingValue]) => ({ | ||
term: { | ||
[`slo.groupings.${groupingKey}`]: groupingValue, | ||
}, | ||
})), |
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 filter the summary documents to match the other grouping key/value pairs. So the values returned for the specified groupingKey form a valid instanceId when set together with the other pairs
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, but was flaky
Failed CI StepsMetrics [docs]Module Count
Public APIs missing comments
Async chunks
History
cc @kdelemme |
Starting backport for target branches: 8.x |
(cherry picked from commit 7806861)
💚 All backports created successfully
Note: Successful backport PRs will be merged automatically after passing CI. Questions ?Please refer to the Backport tool documentation |
# Backport This will backport the following commits from `main` to `8.x`: - [feat(slo): SLO grouping values selector (#202364)](#202364) <!--- Backport version: 9.4.3 --> ### 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-05T18:51:03Z","message":"feat(slo): SLO grouping values selector (#202364)","sha":"7806861c5fc742cc09156655413d3d5c2ab87fda","branchLabelMapping":{"^v9.0.0$":"main","^v8.18.0$":"8.x","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","v9.0.0","backport:prev-minor","ci:project-deploy-observability","Team:obs-ux-management","v8.18.0"],"title":"feat(slo): SLO grouping values selector","number":202364,"url":"https://github.com/elastic/kibana/pull/202364","mergeCommit":{"message":"feat(slo): SLO grouping values selector (#202364)","sha":"7806861c5fc742cc09156655413d3d5c2ab87fda"}},"sourceBranch":"main","suggestedTargetBranches":["8.x"],"targetPullRequestStates":[{"branch":"main","label":"v9.0.0","branchLabelMappingKey":"^v9.0.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/202364","number":202364,"mergeCommit":{"message":"feat(slo): SLO grouping values selector (#202364)","sha":"7806861c5fc742cc09156655413d3d5c2ab87fda"}},{"branch":"8.x","label":"v8.18.0","branchLabelMappingKey":"^v8.18.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}] BACKPORT--> Co-authored-by: Kevin Delemme <[email protected]>
Resolves #198009
🏇🏻 Summary
This PR introduces a way to switch from one instance to another for a given SLO. It replaces the current displaying of the grouping key/value in the SLO details page by a searchable combobox of all possible values for each grouping key.
The list is searchable and excludes the stale SLO instances.
Note
I refactored the existing internal API
GET /slos/{id}/_instances
which was not in use from within Kibana. The API is now accessible underGET /slos/{id}/_groupings
This new API takes two mandatory fields:
groupingKey
andinstanceId
. We use the provided instanceId to derive the term filters on the other groupingKeys (if more than one).🧬 Testing
node x-pack/scripts/data_forge.js --events-per-cycle 30 --lookback now-1d --dataset fake_stack --install-kibana-assets --kibana-url http://localhost:5601/kibana
slo_goruping_value_selection_final.mov