Skip to content

[SLO] exclude stale SLOs from group by stats#240077

Merged
mgiota merged 3 commits intoelastic:mainfrom
mgiota:exclude_stale_stats_from_group_by_stats
Nov 4, 2025
Merged

[SLO] exclude stale SLOs from group by stats#240077
mgiota merged 3 commits intoelastic:mainfrom
mgiota:exclude_stale_stats_from_group_by_stats

Conversation

@mgiota
Copy link
Copy Markdown
Contributor

@mgiota mgiota commented Oct 22, 2025

Fixes #240075

Stale SLOs (SLOs not updated within the defined stale threshold under SLO > Settings) are hidden by default from the SLO overview list. However when user groups by instance id, the stale SLOs were not excluded from the group by stats shown in the accordion title. This PR excludes stale SLOs from the group by stats.

Before

Screenshot 2025-10-22 at 14 30 32

After

Screenshot 2025-10-22 at 14 33 37

Note
If user wants to see the stale SLOs, they can click on the Stale stat number and the stale SLOs will be displayed.

@mgiota mgiota self-assigned this Oct 22, 2025
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Oct 22, 2025
@mgiota mgiota added Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. bug Fixes for quality problems that affect the customer experience and removed author:obs-ux-management PRs authored by the obs ux management team labels Oct 22, 2025
@mgiota mgiota marked this pull request as ready for review October 22, 2025 12:06
@mgiota mgiota requested a review from a team as a code owner October 22, 2025 12:06
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

Comment on lines +36 to +61
function excludeStaleSummaryFilter(
settings: StoredSLOSettings,
kqlFilter: string,
hideStale?: boolean
): estypes.QueryDslQueryContainer[] {
if (kqlFilter.includes('summaryUpdatedAt') || !settings.staleThresholdInHours || !hideStale) {
return [];
}
return [
{
bool: {
should: [
{ term: { isTempDoc: true } },
{
range: {
summaryUpdatedAt: {
gte: `now-${settings.staleThresholdInHours}h`,
},
},
},
],
},
},
];
}

Copy link
Copy Markdown
Contributor

@baileycash-elastic baileycash-elastic Oct 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I saw that this function already exists here. Is it better to import the original here or move to a shared source file?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I created a shared utility in this commit

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] Scout Test Run Builder / serverless-security - EUI testing wrapper: EuiDataGrid - data grid, run

Metrics [docs]

✅ unchanged

History

cc @mgiota

Copy link
Copy Markdown
Contributor

@baileycash-elastic baileycash-elastic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm :)

@mgiota mgiota merged commit 82528fc into elastic:main Nov 4, 2025
22 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 8.19, 9.1, 9.2

https://github.com/elastic/kibana/actions/runs/19080850953

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Nov 4, 2025
Fixes elastic#240075

Stale SLOs (SLOs not updated within the defined stale threshold under
SLO > Settings) are hidden by default from the SLO overview list.
However when user groups by instance id, the stale SLOs were not
excluded from the group by stats shown in the accordion title. This PR
excludes stale SLOs from the group by stats.

**Before**

<img width="600" height="681" alt="Screenshot 2025-10-22 at 14 30 32"
src="https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9"
/>

**After**

<img width="600" height="623" alt="Screenshot 2025-10-22 at 14 33 37"
src="https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a"
/>

**Note**
If user wants to see the stale SLOs, they can click on the `Stale stat`
number and the stale SLOs will be displayed.

(cherry picked from commit 82528fc)
@kibanamachine
Copy link
Copy Markdown
Contributor

💔 Some backports could not be created

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [SLO] Use internal es client for fetching remote cluster info !! (#224870)
9.1 Backport failed because of merge conflicts
9.2

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 240077

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Nov 4, 2025
# Backport

This will backport the following commits from `main` to `9.2`:
- [[SLO] exclude stale SLOs from group by stats
(#240077)](#240077)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Panagiota
Mitsopoulou","email":"panagiota.mitsopoulou@elastic.co"},"sourceCommit":{"committedDate":"2025-11-04T19:43:40Z","message":"[SLO]
exclude stale SLOs from group by stats (#240077)\n\nFixes
https://github.com/elastic/kibana/issues/240075\n\nStale SLOs (SLOs not
updated within the defined stale threshold under\nSLO > Settings) are
hidden by default from the SLO overview list.\nHowever when user groups
by instance id, the stale SLOs were not\nexcluded from the group by
stats shown in the accordion title. This PR\nexcludes stale SLOs from
the group by stats.\n\n**Before**\n\n<img width=\"600\" height=\"681\"
alt=\"Screenshot 2025-10-22 at 14 30
32\"\nsrc=\"https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9\"\n/>\n\n**After**\n\n<img
width=\"600\" height=\"623\" alt=\"Screenshot 2025-10-22 at 14 33
37\"\nsrc=\"https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a\"\n/>\n\n\n**Note**\nIf
user wants to see the stale SLOs, they can click on the `Stale
stat`\nnumber and the stale SLOs will be
displayed.","sha":"82528fcd2f7f353bcdd248a1c11c34d40d6a9cf8","branchLabelMapping":{"^v9.3.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["bug","release_note:fix","Team:obs-ux-management","backport:version","v9.3.0","v8.19.7","v9.1.7","v9.2.1"],"title":"[SLO]
exclude stale SLOs from group by
stats","number":240077,"url":"https://github.com/elastic/kibana/pull/240077","mergeCommit":{"message":"[SLO]
exclude stale SLOs from group by stats (#240077)\n\nFixes
https://github.com/elastic/kibana/issues/240075\n\nStale SLOs (SLOs not
updated within the defined stale threshold under\nSLO > Settings) are
hidden by default from the SLO overview list.\nHowever when user groups
by instance id, the stale SLOs were not\nexcluded from the group by
stats shown in the accordion title. This PR\nexcludes stale SLOs from
the group by stats.\n\n**Before**\n\n<img width=\"600\" height=\"681\"
alt=\"Screenshot 2025-10-22 at 14 30
32\"\nsrc=\"https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9\"\n/>\n\n**After**\n\n<img
width=\"600\" height=\"623\" alt=\"Screenshot 2025-10-22 at 14 33
37\"\nsrc=\"https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a\"\n/>\n\n\n**Note**\nIf
user wants to see the stale SLOs, they can click on the `Stale
stat`\nnumber and the stale SLOs will be
displayed.","sha":"82528fcd2f7f353bcdd248a1c11c34d40d6a9cf8"}},"sourceBranch":"main","suggestedTargetBranches":["8.19","9.1","9.2"],"targetPullRequestStates":[{"branch":"main","label":"v9.3.0","branchLabelMappingKey":"^v9.3.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/240077","number":240077,"mergeCommit":{"message":"[SLO]
exclude stale SLOs from group by stats (#240077)\n\nFixes
https://github.com/elastic/kibana/issues/240075\n\nStale SLOs (SLOs not
updated within the defined stale threshold under\nSLO > Settings) are
hidden by default from the SLO overview list.\nHowever when user groups
by instance id, the stale SLOs were not\nexcluded from the group by
stats shown in the accordion title. This PR\nexcludes stale SLOs from
the group by stats.\n\n**Before**\n\n<img width=\"600\" height=\"681\"
alt=\"Screenshot 2025-10-22 at 14 30
32\"\nsrc=\"https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9\"\n/>\n\n**After**\n\n<img
width=\"600\" height=\"623\" alt=\"Screenshot 2025-10-22 at 14 33
37\"\nsrc=\"https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a\"\n/>\n\n\n**Note**\nIf
user wants to see the stale SLOs, they can click on the `Stale
stat`\nnumber and the stale SLOs will be
displayed.","sha":"82528fcd2f7f353bcdd248a1c11c34d40d6a9cf8"}},{"branch":"8.19","label":"v8.19.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.1","label":"v9.1.7","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"},{"branch":"9.2","label":"v9.2.1","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Panagiota Mitsopoulou <panagiota.mitsopoulou@elastic.co>
wildemat pushed a commit to wildemat/kibana that referenced this pull request Nov 5, 2025
Fixes elastic#240075

Stale SLOs (SLOs not updated within the defined stale threshold under
SLO > Settings) are hidden by default from the SLO overview list.
However when user groups by instance id, the stale SLOs were not
excluded from the group by stats shown in the accordion title. This PR
excludes stale SLOs from the group by stats.

**Before**

<img width="600" height="681" alt="Screenshot 2025-10-22 at 14 30 32"
src="https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9"
/>

**After**

<img width="600" height="623" alt="Screenshot 2025-10-22 at 14 33 37"
src="https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a"
/>


**Note**
If user wants to see the stale SLOs, they can click on the `Stale stat`
number and the stale SLOs will be displayed.
viduni94 pushed a commit to viduni94/kibana that referenced this pull request Nov 5, 2025
Fixes elastic#240075

Stale SLOs (SLOs not updated within the defined stale threshold under
SLO > Settings) are hidden by default from the SLO overview list.
However when user groups by instance id, the stale SLOs were not
excluded from the group by stats shown in the accordion title. This PR
excludes stale SLOs from the group by stats.

**Before**

<img width="600" height="681" alt="Screenshot 2025-10-22 at 14 30 32"
src="https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9"
/>

**After**

<img width="600" height="623" alt="Screenshot 2025-10-22 at 14 33 37"
src="https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a"
/>


**Note**
If user wants to see the stale SLOs, they can click on the `Stale stat`
number and the stale SLOs will be displayed.
eokoneyo pushed a commit to eokoneyo/kibana that referenced this pull request Dec 2, 2025
Fixes elastic#240075

Stale SLOs (SLOs not updated within the defined stale threshold under
SLO > Settings) are hidden by default from the SLO overview list.
However when user groups by instance id, the stale SLOs were not
excluded from the group by stats shown in the accordion title. This PR
excludes stale SLOs from the group by stats.

**Before**

<img width="600" height="681" alt="Screenshot 2025-10-22 at 14 30 32"
src="https://github.com/user-attachments/assets/fba3458e-bf05-49ec-a25a-4aa64ff973a9"
/>

**After**

<img width="600" height="623" alt="Screenshot 2025-10-22 at 14 33 37"
src="https://github.com/user-attachments/assets/34f7b070-ed3c-4662-83c3-84b77048544a"
/>


**Note**
If user wants to see the stale SLOs, they can click on the `Stale stat`
number and the stale SLOs will be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels bug Fixes for quality problems that affect the customer experience release_note:fix Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v8.19.7 v9.1.7 v9.2.1 v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[SLO] Sync stale stats with group by stats

4 participants