Skip to content

feat(slo): add to case#228976

Merged
kdelemme merged 63 commits intoelastic:mainfrom
kdelemme:slo/cases-integration
Jul 28, 2025
Merged

feat(slo): add to case#228976
kdelemme merged 63 commits intoelastic:mainfrom
kdelemme:slo/cases-integration

Conversation

@kdelemme
Copy link
Copy Markdown
Contributor

@kdelemme kdelemme commented Jul 22, 2025

Summary

Resolves #228065

This PR adds a "add to case" action on the SLO details page, using the new case attachment page. It also introduces some changes in how we handle the history tab state in order to sync the date range with the URL, which is then used when creating the attachment URL.

Testing

pre-requisites

node x-pack/scripts/data_forge.js --events-per-cycle 10  --lookback now-2d --dataset fake_stack --install-kibana-assets --kibana-url http://localhost:5601

From the SLO details page

  • Create an SLO, go to SLO Details
  • Open the Action menu and click on "Add to case"
  • Create a new case, assert the SLO is attached as a page attachment
  • Add to an existing case, assert the SLO is attached as a page attachment

From the SLO details page history tab

  • Go to the SLO history
  • Select a time range in the past for example
  • Open the Action menu and click on "Add to case"
  • Create a new case, assert the SLO is attached as a page attachment and the link redirects to the history page with the correct range
  • Add to an existing case, assert the SLO is attached as a page attachment and the link redirects to the history page with the correct range

@kdelemme kdelemme self-assigned this Jul 22, 2025
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label Jul 22, 2025
@kdelemme kdelemme added release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. v9.2.0 and removed author:obs-ux-management PRs authored by the obs ux management team labels Jul 22, 2025
mistic and others added 20 commits July 23, 2025 08:45
…228747)

Resolves the changePoint part of elastic#227446

### Summary
This PR improves the UX of opening embeddable flyouts for Change Point
Chart by making the flyout appear immediately, without waiting for async
content.

### Key Changes
✅ Removed the Promise-based flyout initialization that simulated event
handling.
✅ Replaced it with the standardized openLazyFlyout() from
@kbn/presentation-util.
✅ Lazy-loaded content is now fetched after the flyout opens, improving
perceived performance.
✅ Cleaned up onEdit and createAction handlers to simplify logic and use
consistent patterns.

### Why
To make the flyout open faster, improving user experience by avoiding
delays caused by waiting for async content to load.

---------

Co-authored-by: mbondyra <marta.bondyra@elastic.co>
…nd Label translation of PrivMon tiles (elastic#228713)

## Summary

The title and label for the privmon tiles were always in English.
This PR changes the implementation to use `i18n.translate` which returns
a localized string for title and label of privmon tiles based on the
user's language settings.

### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.
…astic#228164)

Closes elastic#221758

## Summary

- alerts table: added the toggle button in the columns dropdown, to
hide/unhide specific columns


<img width="1470" height="690" alt="Screenshot 2025-07-16 at 14 52 52"
src="https://github.com/user-attachments/assets/c8361f25-3ba1-4608-8366-12e47c43f563"
/>
…ic#227483)

## Summary

Closes elastic#228589

Relocate streams api tests to platform directory

I added an intentional failure to ensure the tests where correctly run
(see https://buildkite.com/elastic/kibana-pull-request/builds/321083)

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Fixes: elastic#226506

This PR fixes the bug: `xpack.reporting.queue.pollEnabled` config to be
ignored by the `mget` claim strategy.

## To verify: 

Set  `xpack.reporting.queue.pollEnabled: false` in your kibana.yml.
Then try to generate a report.
The task should be successfully created but its status should remain as
`pending` on the reports page.

<img width="999" height="343" alt="Screenshot 2025-07-21 at 02 35 40"
src="https://github.com/user-attachments/assets/0e7d5959-76c4-4519-ac3e-a3ca56f57f37"
/>
… range) (elastic#227298)

- Addresses elastic#218509

## Summary

This PR introduces a way to keep track of the unsubmitted changes in
UnifiedSearch component (`query`, `dateRangeFrom` and `dateRangeTo`) and
restores when when switching tabs in Discover. It does not use
`@kbn/restorable-state` because
`src/platform/plugins/shared/unified_search/public/search_bar/search_bar.tsx`
is a class component which would require a lot of refactoring otherwise.
Instead, the PR introduces `draft` and `onDraftChange` optional props
for UnifiedSearch. They allow to mount a search bar with a prefilled
query state and it will be visually rendered as "dirty" (with "Update"
button).

- [x] unsubmitted KQL query and unsubmitted time range
- [x] unsubmitted ES|QL query and unsubmitted time range

Saving `uiState.searchDraft` per tab will allow us to address other
issues too jughosta#19.

### Testing

To enable tabs in Discover, run
`localStorage.setItem('discoverExperimental:tabs', 'true')` in browser
Console.

### Checklist

- [x] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [x] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [x] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [x] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…tic#228454)

## Summary
Resolves the inspector part of
elastic#227446

✅ Summary
1. Removed the unused __LEGACY construct.
2. Moved all exports for code we want to load asynchronously into
async_services. This bundles related async chunks (e.g., InspectPanel
and its content) together, avoiding unnecessary multiple small chunks.
We should consider using this pattern more widely to reduce chunk
overhead.
3. There’s not much immediate benefit to using lazyFlyout here, but it
helps avoid exposing the `trackOverlays` API and keeps the code
consistent.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary

These tests were skipped a few months ago due to flakyness. We've
investigated and the suite seems to be stable now. We see no reasons for
the flakyness or failures.
As such, we're re-enabling the test suite.
## Summary

Rewrite tool ids for the MCP endpoint, similar to what we do internally
when calling LLMs in our framework, to ensure IDs are LLM-compatible.
…ed data streams (elastic#228802)

Closes elastic#211020

## Summary

This PR fixes an issue where `Edit data retention` bulk action was
available when data stream fully managed by ILM was selected.
…28086)

## Summary

Closes elastic#214592 

This PR adds `text-decoration: dotted underline` to search result
highlights due to accessibility reasons.

<img width="1427" height="493" alt="Screenshot 2025-07-15 at 21 08 59"
src="https://github.com/user-attachments/assets/c9edb19a-7a59-4aef-b8fe-91f424f62abf"
/>

<img width="542" height="774" alt="Screenshot 2025-07-15 at 21 07 50"
src="https://github.com/user-attachments/assets/e7be0fd1-78d0-46a7-abc4-ec6f4652c7ab"
/>




### Checklist

Check the PR satisfies following conditions. 

Reviewers should verify this PR satisfies this list as well.

- [ ] Any text added follows [EUI's writing
guidelines](https://elastic.github.io/eui/#/guidelines/writing), uses
sentence case text and includes [i18n
support](https://github.com/elastic/kibana/blob/main/src/platform/packages/shared/kbn-i18n/README.md)
- [ ]
[Documentation](https://www.elastic.co/guide/en/kibana/master/development-documentation.html)
was added for features that require explanation or tutorials
- [ ] [Unit or functional
tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html)
were updated or added to match the most common scenarios
- [ ] If a plugin configuration key changed, check if it needs to be
allowlisted in the cloud and added to the [docker
list](https://github.com/elastic/kibana/blob/main/src/dev/build/tasks/os_packages/docker_generator/resources/base/bin/kibana-docker)
- [ ] This was checked for breaking HTTP API changes, and any breaking
changes have been approved by the breaking-change committee. The
`release_note:breaking` label should be applied in these situations.
- [ ] [Flaky Test
Runner](https://ci-stats.kibana.dev/trigger_flaky_test_runner/1) was
used on any tests changed
- [ ] The PR description includes the appropriate Release Notes section,
and the correct `release_note:*` label is applied per the
[guidelines](https://www.elastic.co/guide/en/kibana/master/contributing.html#kibana-release-notes-process)
- [ ] Review the [backport
guidelines](https://docs.google.com/document/d/1VyN5k91e5OVumlc0Gb9RPa3h1ewuPE705nRtioPiTvY/edit?usp=sharing)
and apply applicable `backport:*` labels.

### Identify risks

Does this PR introduce any risks? For example, consider risks like hard
to test bugs, performance regression, potential of data loss.

Describe the risk, its severity, and mitigation for each identified
risk. Invite stakeholders and evaluate how to proceed before merging.

- [ ] [See some risk
examples](https://github.com/elastic/kibana/blob/main/RISK_MATRIX.mdx)
- [ ] ...
### Summary

This is one of the PRs to remove setup guides plugin based on this
[Epic](elastic/kibana-team#1573).

We are deprecating `@kbn/guided-onboarding-plugin` because this
interface is not used anymore, since each solution uses their own
onboarding flow. And because of this - this PR is cleaning up the Search
code to remove setup guides/guided onboarding logic.

Then after this is completed - we will remove the plugin from the
platform completely.

The setup guides I am referring to here are 

<img width="1028" height="587" alt="Screenshot 2025-07-18 at 13 44 03"
src="https://github.com/user-attachments/assets/f6e7c84b-b78b-43de-a745-dd7250f19ca7"
/>

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
…valuating a criterion (elastic#228827)

## Summary

Add fallback score when judge misses evaluating a criterion:
- The score is `0` and reasoning: `No score returned by LLM judge,
defaulting to 0.`
- While the issue of inconsistent evaluation score was mitigated by
elastic#226983, I still found that very
rarely, the judge misses a criterion. With this change scoring has a
fallback that will return the results with 100% consistency in terms of
what was evaluated.

### Testing

- Since this inconsistency happens rarely, it is really hard to
reproduce without tweaking the judge prompt to intentionally fail, by
updating the system prompt of the judge
([here](https://github.com/elastic/kibana/blob/main/x-pack/solutions/observability/plugins/observability_ai_assistant_app/scripts/evaluation/kibana_client.ts#L534))
with something like:
```
   ### Scoring Contract

  * You MUST call the function "scores" exactly once.  
  * Only and only evaluate the second criterion (reject all others).`,
```
Then you can see the fallback scores populating in the evaluation and
keeping the `total` consistent regardless of how well the `score` works.

Example from intentionally failed scoring with the prompt change above:
<img width="994" height="278" alt="image"
src="https://github.com/user-attachments/assets/d4bb94bc-4f7e-4982-95ca-cae2159d5ff7"
/>

---------

Co-authored-by: Søren Louv-Jansen <sorenlouv@gmail.com>
…stic#228906)

## Summary

It makes sense for this to be owned by observability-ui then
obs-ux-management team !!
@kdelemme kdelemme marked this pull request as ready for review July 23, 2025 19:54
@kdelemme kdelemme requested a review from a team as a code owner July 23, 2025 19:54
@elasticmachine
Copy link
Copy Markdown
Contributor

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

Comment on lines +28 to +32
const getCasesContext = cases?.ui?.getCasesContext;
const canUseCases = cases?.helpers?.canUseCases;

const CasesContext = getCasesContext?.();
const permissions = canUseCases?.();
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.

Bit ugly that everything is potentially undefined

? `?instanceId=${encodeURIComponent(instanceId)}`
: '';
const path = !!sloId ? `/${encodeURIComponent(sloId)}${queryParams}` : '/';
public readonly getLocation = async ({ sloId, instanceId, tabId }: SloDetailsLocatorParams) => {
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.

Not use in this PR but refactored this locator

},
};

export function useUrlAppState(slo: SLOWithSummaryResponse | SLODefinitionResponse): {
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.

This is specifically to handle the state of the history tab using the URL


if (selectedTabId === HISTORY_TAB_ID) {
return <SloDetailsHistory slo={slo} isAutoRefreshing={isAutoRefreshing} />;
return <SloDetailsHistory slo={slo} />;
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.

removing auto refresh on the history tab

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
slo 1276 1278 +2

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
slo 976.2KB 979.3KB +3.1KB

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
slo 32.6KB 32.9KB +291.0B

History

cc @kdelemme

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

@kdelemme kdelemme merged commit 1f42a51 into elastic:main Jul 28, 2025
13 checks passed
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
fkanout added a commit to fkanout/kibana that referenced this pull request Sep 30, 2025
fkanout added a commit that referenced this pull request Sep 30, 2025
VladimirFilonov pushed a commit to VladimirFilonov/kibana that referenced this pull request Sep 30, 2025
rylnd pushed a commit to rylnd/kibana that referenced this pull request Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[R&D] Start an incident from an SLO (without an active alert)