# Backport
This will backport the following commits from `main` to `8.x`:
- [Use groupBy when groupings is not populated correctly
(#189672)](https://github.com/elastic/kibana/pull/189672)
<!--- Backport version: 9.4.3 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sqren/backport)
<!--BACKPORT [{"author":{"name":"Kevin
Delemme","email":"kevin.delemme@elastic.co"},"sourceCommit":{"committedDate":"2024-09-19T17:19:23Z","message":"Use
groupBy when groupings is not populated correctly
(#189672)","sha":"c509747a7b59da5eec63d95792404b1ad3559131","branchLabelMapping":{"^v9.0.0$":"main","^v8.16.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.16.0"],"title":"Use
groupBy when groupings is not populated
correctly","number":189672,"url":"https://github.com/elastic/kibana/pull/189672","mergeCommit":{"message":"Use
groupBy when groupings is not populated correctly
(#189672)","sha":"c509747a7b59da5eec63d95792404b1ad3559131"}},"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/189672","number":189672,"mergeCommit":{"message":"Use
groupBy when groupings is not populated correctly
(#189672)","sha":"c509747a7b59da5eec63d95792404b1ad3559131"}},{"branch":"8.x","label":"v8.16.0","branchLabelMappingKey":"^v8.16.0$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
Co-authored-by: Kevin Delemme <kevin.delemme@elastic.co>
## Summary
Fixes https://github.com/elastic/kibana/issues/173771
Use saved data view id instead of index pattern where it's available.
Inject runtime mappings from the dataview into transform.
- [ ] Go to Discover and add a runtime field to the data view (this is
only available in Discover)
- [ ] Make sure filtering works based on the data view
We are not supporting "scripted fields" from the Index Management
DataView editor.
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes https://github.com/elastic/kibana/issues/176712
Added a way to define threshold to declare SLOs stale state , for now i
have chosen if it hasn't been updated in 48 hours, need product feedback
on this
<img width="1145" alt="image"
src="2ce11a60-2ed5-4929-a8ab-9d26d93f6956">
Added an overview panel to indicate how many SLOs are in stale state ,
user can click on each EuiState component to filter SLOs by
<img width="1725" alt="image"
src="352a893d-083d-4448-91bd-6737cfbe63f1">
Also added Alerts overview , clicking will take user to alerts or rules
page, pref filtered with burn rate
<img width="505" alt="image"
src="97387708-54e5-4c0d-9a09-d740e2087e79">
## Summary
Resolves https://github.com/elastic/kibana/issues/179046
Summarize your PR. If it involves visual changes include a screenshot or
gif.
Applies filters based on the selected APM indicator params to the
cardinality count query.
<img width="845" alt="Screenshot 2024-05-10 at 1 07 27 PM"
src="7283f7cc-b141-47e2-883e-e463556e4aec">
### Testing.
1. Create mock api data via `node scripts/synthtrace continuous_rollups
--live`
2. Navigate to create SLI and choose APM latency
3. Select a service
4. Select group by as `service.name`. Cardinality count should be 1
5. Select environment all and change the group by to
`service.environment`. Cardinality count should be 2.
6. Now select a specific environment. Notice cardinality count changes
to 1.
7. Repeat this testing strategy with transaction name and transaction
type, changing the group by field to `transaction.name` or
`transaction.type`, respectively and playing around with the ALL_VALUE
versus a specific value.
8. Also make sure to test the global filter for regressions
### Release note
The cardinality count for SLOs generated from a single SLI definition
was previously incorrect for APM latency and APM availability SLIs. The
cardinality count is now accurate.
## Summary
This will allow users to view data beyond default values in details page
chart, users will be able to select date range via picker to view
historical SLI, Burn rate or Good/Bad Events chart
48a6a029-ad36-4457-b195-4ab2d739fca0
<img width="1726" alt="image"
src="c8936443-5fe4-4925-9a9f-a22c847f32b7">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
Fixes https://github.com/elastic/kibana/issues/181739
Disable federated view settings in serverless !!
- [ ] Disabled route and settings page in public
- [ ] Uses different put request schema on serverless which doesn't
contains remote cluster settings
## Summary
Resolves https://github.com/elastic/kibana/issues/179075
Filters out no data values (-1) for slo preview chart, in order to
ensure that the bounds do not end up spanning all the way to -100%.
Before
<img width="822" alt="Screenshot 2024-04-24 at 1 46 20 PM"
src="30b7cd9e-d4a1-4e9a-b5a0-e5fb8d1fe857">
After
<img width="833" alt="Screenshot 2024-04-24 at 1 42 54 PM"
src="ea63be37-46f8-4212-b0b4-f01038f5b353">
Fixes https://github.com/elastic/kibana/issues/178446
This PR adds the following AI Ops features to the Burn rate alert detail
page:
- Log Rate Analysis
- ML features / AI Assistant
bf00c636-10ab-4cd8-859b-4a8f0471bf15
## Implementation details
Log rate analysis is useful when there is a significant dip/spike in
number of logs. It finds significant differences between the logs in
baseline (before dip/spike) and in deviation (after dip/spike). For the
Log Rate Analysis to work on the Alert details of an SLO burn rate rule
we had to specify a few params, here are the most important ones:
- dataView
- esSearchQuery
- timeRange -> I am looking into this and need a few clarifications
regarding lookBackPeriod
- initialAnalysisStart
For the esQuery here's what we used
```
const finalQuery = {
bool: {
filter: [customTotalFilter, customFilters, customGroupByFilters],
must_not: customGoodFilter,
},
};
```
We add the `total query`, any `optional filters` and any `group by
filters` to the `filter` clause of the ES query, where as we add the
good filter in the `must_not` clause.
## 🔬 How to test
- Add the following lines to your `config/kibana.dev.yaml`:
- `server.basePath: '/kibana'`
- `server.publicBaseUrl: 'http://localhost:5601/kibana'`
- Start with the following command: `node x-pack/scripts/data_forge.js
--events-per-cycle 50 --lookback now-1d --dataset fake_stack
--install-kibana-assets --kibana-url http://localhost:5601/kibana
--event-template good` to start with some good events
- Wait til the log message says `info Waiting 60000ms`
- Create one SLO:
- "Admin Console Availability" using the "Custom Query" SLI with the
`Admin Console` DataView, set the "Good query" to
`http.response.status_code < 500` and the set the "Total query" to
`http.response.status_code: *` using a rolling `7d` time window
- You should have 1 burn rate rule created by default
- Stop the first `data_forge.js` command
- Start `node x-pack/scripts/data_forge.js --events-per-cycle 50
--lookback now --dataset fake_stack --install-kibana-assets --kibana-url
http://localhost:5601/kibana --event-template bad`
- Go to alert details page of the burn rate rule to verify that the Log
Rate Analysis tool detected a spike
Note: you can skip first step, but in this case you should start kibana
with this command instead `yarn start --no-base-path`. This way you
don't have to pass `--kibana-url` when running the `data_forge` command
I included some snapshot tests with different SLOs that could be used
for verifying the generation of the ES query. Here are a few examples:
- Good query (KQL), no filter, no total query
- Good query (filter), no optional filter, no total query
- Good query (kql) optional filter (KQL), no total query
- Good query (kql), optional filter (filter), no total query
- Good query (kql), optional filter (kql), total query (kql)
- Good query (filter), optional filter(filter), total query(kql)
💀 I will need extra help testing this feature, to make sure that
provided params to the `LogRateAnalysisContent` component. Especially
`esSearchQuery` and `timeRange` (timeRange still WIP, but I want some
early feedback on the lookbackDuration and the intervalFactor)
## ✔️ Acceptance criteria
- Render the Log Rate Analysis tool only to platinum users and above
- Render AI assistant contextual insights only to platinum users and
above
---------
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
Co-authored-by: Walter Rafelsberger <walter.rafelsberger@elastic.co>
Fixes https://github.com/elastic/kibana/issues/179908
Fixes https://github.com/elastic/kibana/issues/1798952924e619-9080-4c80-b5c3-7066a100026c
## UI changes
### SLO Overview configuration
<img width="600" alt="Screenshot 2024-04-15 at 13 34 21"
src="3635c9e7-e5c1-454b-bb60-93b5d637083e">
### Rendered panel with Group of SLOs
<img width="1022" alt="Screenshot 2024-04-03 at 13 08 11"
src="377c5cd0-b6e0-4906-888b-93893a5f1208">
### Updated SLO list group by page
<img width="1316" alt="Screenshot 2024-03-28 at 23 56 12"
src="d6b306a0-77e8-44e5-b103-ce3537b0ceda">
## Responsiveness
This PR makes sure that the UI doesn't look broken in smaller screen
resolutions and fixes following issues. If we want to display things
differently in smaller screen resolutions, we should handle in a follow
up PR (cc @maciejforcone)
### Before
#### SLO list page in smaller screen resolution
<img width="500" alt="Screenshot 2024-04-03 at 10 14 31"
src="f2b11408-3356-4f4b-9c4b-ec085ff494fa">
#### Rendered panel with Group of SLOs in smaller screen resolution
<img width="500" alt="Screenshot 2024-04-03 at 10 13 18"
src="6e37ad61-5a0a-4027-8b90-4f8fad243637">
#### After
#### SLO list page in smaller screen resolution
<img width="500" alt="Screenshot 2024-04-03 at 11 04 35"
src="fa875aa8-bc54-4c6b-9159-4462e585a9cb">
#### Rendered panel with Group of SLOs in smaller screen resolution
I applied a `min-width` of 100px to the SLO name, so that it doesn't
look broken. What is not visible in the screenshot is a horizontal
scrollbar, so user can still see the part with Worst performing that is
not visible.
<img width="500" alt="Screenshot 2024-04-03 at 10 13 47"
src="d9566ca3-42af-4d85-a3f7-6374cc27981d">
## Acceptance criteria
- Overview configuration
- toggles between Single SLO or Grouped SLOs
- Required field for the `Grouped SLOs` view is only the `Group by`
option, the rest filters are optional
- Users can optionally select the groups they want
- Users can use the KQL bar to apply extra filters
- Overview configuration opens in a `Flyout` (modal was causing some
issues with z-index and kqlbar suggestions being displayed below the
overlay)
- Embeddable panel
- The rendered panel shows the selected groups with summary data divided
with a horizontal like and no border around it
- Clicking on a group opens an accordion similar to the SLO list group
by page
- An Edit criteria link is visible only in the Grouped Embeddable panel
- Clicking on the Edit criteria link opens the configuration modal,
showing only the grouped tab and hiding the tabbed button group
- The grouped embeddable should react to Dashboard's Refresh button
- `Add to Dashboard` action should be hidden in Dashboard context
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Co-authored-by: Cee Chen <549407+cee-chen@users.noreply.github.com>
## Summary
Enables grouping SLOs by multiple fields.
Resolves https://github.com/elastic/kibana/issues/174228
Adjusts the `instanceId`
[implementation](https://github.com/elastic/kibana/pull/175063/files#diff-c9c4989cf8d323448464b70825408b535b1fa6cc355df26a2acfba45d8c05232R35)
to concat values from each field to build the instance id.
Uses the `groupings` key from the
[summary](https://github.com/elastic/kibana/pull/175063/files#diff-40b886fca239a397d0990f3db135f7b35822ee0aa93063be219bd23cafc9be6cR137)
[documents](https://github.com/elastic/kibana/pull/175063/files#diff-d5cd07fb8fb91091a7f65d9f59c268600f03305167b375ec579773144428ee68R156)
to display group by values in the SLO list and SLO detail pages.
### Testing
1. Before checking out this PR, create an SLO on main with a group by
2. Check out this PR. The instance information should continue to
populate, now with the field label
<img width="364" alt="Screenshot 2024-02-05 at 9 50 12 PM"
src="d6004cc6-58b8-4319-b28b-b09e7849deba">
<img width="1427" alt="Screenshot 2024-02-05 at 9 50 26 PM"
src="10aacc47-ae68-489d-b728-6f74816e7c69">
<img width="583" alt="Screenshot 2024-02-05 at 9 50 38 PM"
src="50bcc168-bdb7-421b-8a6f-9fd0b079b612">
3. Navigate to the edit flow. The group by field should appear in the
ComboBox.
<img width="803" alt="Screenshot 2024-02-05 at 9 56 28 PM"
src="c9601e61-85b9-49ad-adc0-0ebfad67701e">
4. Attempt to create a second group by
<img width="815" alt="Screenshot 2024-02-05 at 10 57 38 PM"
src="e461681c-720f-4290-a01c-0cd00c9cbb72">
5. Save and observe the created instances.
<img width="716" alt="Screenshot 2024-02-06 at 10 39 56 AM"
src="46599aaa-ac93-4362-943a-4579b2e8c552">
<img width="590" alt="Screenshot 2024-02-06 at 11 24 52 AM"
src="ef9d65fb-301c-446d-a748-e82d8460423c">
<img width="666" alt="Screenshot 2024-02-06 at 11 25 08 AM"
src="6713ba80-6a2a-4087-9335-cfa935bf0ebf">
<img width="1449" alt="Screenshot 2024-02-06 at 11 25 20 AM"
src="c7088ab3-847f-436e-8918-2a5f15593ac4">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
This PR adds support for the Timeslice Metric visualization on the SLO
Detail page.
Fixes#170135
<img width="1756" alt="image"
src="56599b91-8827-4c6a-9df1-ccd80c5ab097">
## Summary
Fixes https://github.com/elastic/kibana/issues/173601
Implement Unified Search in SLO List view
1. SLO title has been removed to make it more consistent with other
kibana apps
2. Feedback button is moved up
3. Auto refresh is removed
<img width="1720" alt="image"
src="0ff6fd83-98ac-4737-bf4f-aa087739f110">
<img width="1728" alt="image"
src="aa71e2e7-3bc8-4be7-afb3-f4b7efffc953">
Filters
<img width="1727" alt="image"
src="d3bbf3d3-d2b3-4574-ae7f-bb8258016930">
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
## Summary
It will show all the associated configs at one place in json form,
configuration, ingest pipeline config, roll up transform and summary
transform config !!
Motivation is to understand things while onboarding devs to slo and
during normal development.
a22ad292-ba59-4145-989e-80803b6a1e3e
## 🍒 Summary
This PR fixes#170905 by adding the aggregation menu to the Custom
Metric indicator to allow the user to pick either `doc_count` or `sum`
for the aggregation.
<img width="1152" alt="image"
src="35aea8bd-d21c-4780-bad6-1efe5fc8902b">
Updates new teams as codeowners for Observability team changes.
Also took the opportunity to:
- Delete some paths that no longer exist
- Split infra code ownership between teams (from #168992)
## Summary
This PR adds the new Timeslice Metric indicator for SLOs. Due to the
nature of these statistical aggregations, this indicator requires the
budgeting method to be set to `timeslices`; we ignore the timeslice
threshold in favor of the threshold set in the metric definition.
Users can create SLOs based on the following aggregations:
- Average
- Min
- Max
- Sum
- Cardinality
- Percentile
- Document count
- Std. Deviation
- Last Value
Other notable feature include:
- The ability to define an equation which supports basic math and logic
- Users can define a threshold based on the equation for good slices vs
bad slices
<img width="800" alt="image"
src="05af1ced-40cd-4a05-9dfc-e83ea7bfb5ab">
### Counter Metric Example
<img width="800" alt="image"
src="05eb5a0f-3043-493d-8add-df0d3bf8de02">
CC: @lucasmoore
---------
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
## Summary
This PR add a new indicator to support histogram fields. This will allow
you to either use a `range` aggregation or `value_count` aggregation for
the good and total events; including support for filtering with KQL on
both event types. When using a `range` aggregation, both the `from` and
`to` thresholds are required for the range and events will be to total
number of events within that range.[ Keep in mind, with the `range`
aggregation, the range includes the `from` value and excludes the `to`
value.](https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html)
This PR also includes support for using the histogram field for a
"Custom Metric" indicator, `sum` is calculated on the values and not the
counts. If you need it calculated on the counts then you have to use the
histogram indicator.
<img width="776" alt="image"
src="1d46b722-df13-417e-bf3b-b3c450933da2">
---------
Co-authored-by: Kevin Delemme <kdelemme@gmail.com>
## Summary
This PR adds support for applying a KQL filter to the good/total
metrics.
<img width="858" alt="image"
src="c271352c-10fd-49f1-89b8-a352b69f7f7c">
Resolves https://github.com/elastic/kibana/issues/156145
Resolves https://github.com/elastic/kibana/issues/160293
## 📝 Summary
This PR fixes a bug related to `shouldUnregister` used on controlled
fields which removes part of the form state while submitting the form,
due to the components unmounting. This is a weird issue between React
Hook Form and React Query, as if we were not using optimistic update
with RQ, we won't notice the problem in the first place.
I have done a few things in this PR:
1. I've introduced a `CreateSLOForm` type to decouple what the API is
expecting (CreateSLOInput) and how we structure the form and store the
form state. This is particularly useful when building a partial
`CreateSLOForm` from a partial url state `_a`.
2. I've introduced a hook that handles the change of indicator
correctly, resetting the default value as we change. The default values
are typed with each indicator schema type, and the hook will throw when
a new indicator is introduced but not handled there.
3. I've removed the custom metric manual useEffect and instead rely on
hidden registered inputs.
4. The time window type handles correctly the initial state, and reload
the default values when we change from rolling <-> calendar aligned.
5. I've grouped some code from the main form component into their own
hook to 1. add a layer of abstraction and 2. make the code more cohesive
6. When the create SLO call fails, we redirect the user to the form with
the previously entered values.
## 🧪 Testing
I would suggest to create and edit some SLOs, playing with the different
time window, budgeting method, indicators.
The main thing to look for are:
1. Switching indicator reset the form as expected
2. When editing an SLO, all the form fields are populated correctly with
the initial SLO values.
3. Creating an SLO with a bad indicator, for example with an invalid KQL
query, will redirect to the form with the previous value filled.
https://www.loom.com/share/516c3d5a1fa74db6bf839cfa0cf41f5d?sid=f0a1a33f-eb29-4b8f-b65f-ffce2313bad8
---------
Co-authored-by: Coen Warmer <coen.warmer@gmail.com>
## Summary
This PR adds a burn rate visualization to the overview tab of the SLO
Detail page. This PR also includes a fix for fetching the index pattern
fields hook; it uses the DataViews service to fetch the fields instead
of the internal API.
<img width="1170" alt="image"
src="41057791-880e-4cc8-a0c7-02a0f18aaeca">
### All good
<img width="1141" alt="image"
src="3ec07efa-e35a-4251-87f3-7ddc836171b7">
### Degrading
<img width="1141" alt="image"
src="a6d347be-7b55-404e-99a1-14ad4a38ad36">
### EVERYTHING IS BURNING 🔥
<img width="1141" alt="image"
src="9ed05875-b907-4a57-8387-a094876dd35e">
### Recovering in the dark
<img width="1151" alt="image"
src="f2999c7a-f97b-474c-8146-4565445df892">
### No data
<img width="1141" alt="image"
src="675a65a4-91b1-4de3-9f51-b65760efbb66">
Resolves https://github.com/elastic/kibana/issues/159948
## 📝 Summary
This PR updates the SLO form to support the calendar aligned time
windows for both create and edit flow.
I've also moved the budgeting method selector down, so when selecting
"timeslices", the timeslices related inputs are shown next to it on the
same line.
| Screenshot | Screenshot |
|--------|--------|
|

|

|