# Backport
This will backport the following commits from `main` to `8.19`:
- [[Dataset quality] degradedDocs rule
(#216026)](#216026)
<!--- Backport version: 10.0.0 -->
### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
<!--BACKPORT [{"author":{"name":"Yngrid
Coello","email":"yngrid.coello@elastic.co"},"sourceCommit":{"committedDate":"2025-06-23T09:30:14Z","message":"[Dataset
quality] degradedDocs rule (#216026)\n\nCloses
https://github.com/elastic/kibana/issues/179173.\n\n## Rule type\nA
dedicated stack rule type was created
`datasetQuality.degradedDocs`.\n<img width=\"1759\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/5004a08d-6f12-4f5e-b27f-5f4db242dcf0\"\n/>\n<img
width=\"2318\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/f8b2664a-f1c6-48c5-a617-c6f1b79bf0f7\"\n/>\n\n\nThis
new rule is aggregated by default using `_index` and could be\nfurther
configured by the user (e.g. user can also aggregate
by\n`cloud.provider`).\n\nA new rule type was needed to be created since
there is no actual way to\naggregate all documents in a dataStream if we
use a DataView like\n`logs-*-*`. Inside datasStream documents there is
no indication about\nthe dataStream where they belong to, instead we
just have `_index` which\ncontains backingIndexName instead of actual
index.\n\nIt's important to note, that this rule type is also visible
from\n`Observability > Alerts`, which is useful specially for
serverless.\n\n\nhttps://github.com/user-attachments/assets/000aee51-4895-4f4c-9484-924ace4325c5\n\n\n##
Role Based Access-Control (RBAC)\nRBAC for dataset quality alerts is
defined within dataQuality kibana\nfeature.\nWe have three privileges
defined:\n1. `all`: This privilege now contains a subFeature
`manage_rules` that\nwill allow for more granularity on alerting level.
It's by default\nassigned to `all` but can be disabled.\n2. `read`: This
privilege is only related to serverless (when we don't\nhave yet custom
roles).\n\nhttps://github.com/user-attachments/assets/70ed5bde-bf45-4024-b448-228799fcaf71\n3.
`none`: This privilege is only relevant for stateful (in serverless\nwe
don't have custom roles).\n\n## 🎥 Demo\n### Serverless\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/8dad6e30-a261-4a69-979f-6dfc2a41c888\n\n####
`read`
privileges\n\nhttps://github.com/user-attachments/assets/e1cb108d-22a0-4e7f-b252-9cc12d1e9d65\n\n###
Stateful\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/d96f3b70-35b2-466b-aa59-a07190d24d93\n\n####
`all` privileges with subFeature
disabled\n\nhttps://github.com/user-attachments/assets/808ab811-9320-43e4-b2a6-06d530a78b82\n\n####
`none` privileges
(Stateful)\n\nhttps://github.com/user-attachments/assets/18f2a2d6-d825-4713-acea-0d72f451e9ab\n\n##
How to test?\n1. run synthrace scenario `degraded_logs` in live
mode\n```\nnode scripts/synthtrace degraded_logs --live\n```\n2. Open
dataset quality page (/app/management/data/data_quality)\n3. Select
`synth.3`
dataset\n(/app/management/data/data_quality/details?pageState=(dataStream:logs-synth.3-default)\n4.
Click on `Actions` and then select `Create rule`\n5. Fill out the alert
form\n6. Go to `Observability > Alerts` or `Stack management >
Alerts`\n(/app/observability/alerts)\n\n## Release note\nAdds the Create
alert rule action to dataset quality page and dataset\nquality details.
This allows you to generate an alert when the\npercentage of degraded
docs on the chart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Aleh
Zasypkin <aleh.zasypkin@elastic.co>\nCo-authored-by: Faisal Kanout
<faisal.kanout@elastic.co>","sha":"64df229998b0db7e5d381c847e60c0d39e6c3120","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["backport","release_note:feature","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0"],"title":"[Dataset
quality] degradedDocs
rule","number":216026,"url":"https://github.com/elastic/kibana/pull/216026","mergeCommit":{"message":"[Dataset
quality] degradedDocs rule (#216026)\n\nCloses
https://github.com/elastic/kibana/issues/179173.\n\n## Rule type\nA
dedicated stack rule type was created
`datasetQuality.degradedDocs`.\n<img width=\"1759\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/5004a08d-6f12-4f5e-b27f-5f4db242dcf0\"\n/>\n<img
width=\"2318\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/f8b2664a-f1c6-48c5-a617-c6f1b79bf0f7\"\n/>\n\n\nThis
new rule is aggregated by default using `_index` and could be\nfurther
configured by the user (e.g. user can also aggregate
by\n`cloud.provider`).\n\nA new rule type was needed to be created since
there is no actual way to\naggregate all documents in a dataStream if we
use a DataView like\n`logs-*-*`. Inside datasStream documents there is
no indication about\nthe dataStream where they belong to, instead we
just have `_index` which\ncontains backingIndexName instead of actual
index.\n\nIt's important to note, that this rule type is also visible
from\n`Observability > Alerts`, which is useful specially for
serverless.\n\n\nhttps://github.com/user-attachments/assets/000aee51-4895-4f4c-9484-924ace4325c5\n\n\n##
Role Based Access-Control (RBAC)\nRBAC for dataset quality alerts is
defined within dataQuality kibana\nfeature.\nWe have three privileges
defined:\n1. `all`: This privilege now contains a subFeature
`manage_rules` that\nwill allow for more granularity on alerting level.
It's by default\nassigned to `all` but can be disabled.\n2. `read`: This
privilege is only related to serverless (when we don't\nhave yet custom
roles).\n\nhttps://github.com/user-attachments/assets/70ed5bde-bf45-4024-b448-228799fcaf71\n3.
`none`: This privilege is only relevant for stateful (in serverless\nwe
don't have custom roles).\n\n## 🎥 Demo\n### Serverless\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/8dad6e30-a261-4a69-979f-6dfc2a41c888\n\n####
`read`
privileges\n\nhttps://github.com/user-attachments/assets/e1cb108d-22a0-4e7f-b252-9cc12d1e9d65\n\n###
Stateful\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/d96f3b70-35b2-466b-aa59-a07190d24d93\n\n####
`all` privileges with subFeature
disabled\n\nhttps://github.com/user-attachments/assets/808ab811-9320-43e4-b2a6-06d530a78b82\n\n####
`none` privileges
(Stateful)\n\nhttps://github.com/user-attachments/assets/18f2a2d6-d825-4713-acea-0d72f451e9ab\n\n##
How to test?\n1. run synthrace scenario `degraded_logs` in live
mode\n```\nnode scripts/synthtrace degraded_logs --live\n```\n2. Open
dataset quality page (/app/management/data/data_quality)\n3. Select
`synth.3`
dataset\n(/app/management/data/data_quality/details?pageState=(dataStream:logs-synth.3-default)\n4.
Click on `Actions` and then select `Create rule`\n5. Fill out the alert
form\n6. Go to `Observability > Alerts` or `Stack management >
Alerts`\n(/app/observability/alerts)\n\n## Release note\nAdds the Create
alert rule action to dataset quality page and dataset\nquality details.
This allows you to generate an alert when the\npercentage of degraded
docs on the chart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Aleh
Zasypkin <aleh.zasypkin@elastic.co>\nCo-authored-by: Faisal Kanout
<faisal.kanout@elastic.co>","sha":"64df229998b0db7e5d381c847e60c0d39e6c3120"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/216026","number":216026,"mergeCommit":{"message":"[Dataset
quality] degradedDocs rule (#216026)\n\nCloses
https://github.com/elastic/kibana/issues/179173.\n\n## Rule type\nA
dedicated stack rule type was created
`datasetQuality.degradedDocs`.\n<img width=\"1759\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/5004a08d-6f12-4f5e-b27f-5f4db242dcf0\"\n/>\n<img
width=\"2318\"
alt=\"image\"\nsrc=\"https://github.com/user-attachments/assets/f8b2664a-f1c6-48c5-a617-c6f1b79bf0f7\"\n/>\n\n\nThis
new rule is aggregated by default using `_index` and could be\nfurther
configured by the user (e.g. user can also aggregate
by\n`cloud.provider`).\n\nA new rule type was needed to be created since
there is no actual way to\naggregate all documents in a dataStream if we
use a DataView like\n`logs-*-*`. Inside datasStream documents there is
no indication about\nthe dataStream where they belong to, instead we
just have `_index` which\ncontains backingIndexName instead of actual
index.\n\nIt's important to note, that this rule type is also visible
from\n`Observability > Alerts`, which is useful specially for
serverless.\n\n\nhttps://github.com/user-attachments/assets/000aee51-4895-4f4c-9484-924ace4325c5\n\n\n##
Role Based Access-Control (RBAC)\nRBAC for dataset quality alerts is
defined within dataQuality kibana\nfeature.\nWe have three privileges
defined:\n1. `all`: This privilege now contains a subFeature
`manage_rules` that\nwill allow for more granularity on alerting level.
It's by default\nassigned to `all` but can be disabled.\n2. `read`: This
privilege is only related to serverless (when we don't\nhave yet custom
roles).\n\nhttps://github.com/user-attachments/assets/70ed5bde-bf45-4024-b448-228799fcaf71\n3.
`none`: This privilege is only relevant for stateful (in serverless\nwe
don't have custom roles).\n\n## 🎥 Demo\n### Serverless\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/8dad6e30-a261-4a69-979f-6dfc2a41c888\n\n####
`read`
privileges\n\nhttps://github.com/user-attachments/assets/e1cb108d-22a0-4e7f-b252-9cc12d1e9d65\n\n###
Stateful\n#### `all`
privileges\n\nhttps://github.com/user-attachments/assets/d96f3b70-35b2-466b-aa59-a07190d24d93\n\n####
`all` privileges with subFeature
disabled\n\nhttps://github.com/user-attachments/assets/808ab811-9320-43e4-b2a6-06d530a78b82\n\n####
`none` privileges
(Stateful)\n\nhttps://github.com/user-attachments/assets/18f2a2d6-d825-4713-acea-0d72f451e9ab\n\n##
How to test?\n1. run synthrace scenario `degraded_logs` in live
mode\n```\nnode scripts/synthtrace degraded_logs --live\n```\n2. Open
dataset quality page (/app/management/data/data_quality)\n3. Select
`synth.3`
dataset\n(/app/management/data/data_quality/details?pageState=(dataStream:logs-synth.3-default)\n4.
Click on `Actions` and then select `Create rule`\n5. Fill out the alert
form\n6. Go to `Observability > Alerts` or `Stack management >
Alerts`\n(/app/observability/alerts)\n\n## Release note\nAdds the Create
alert rule action to dataset quality page and dataset\nquality details.
This allows you to generate an alert when the\npercentage of degraded
docs on the chart crosses a certain
threshold.\n\n---------\n\nCo-authored-by: kibanamachine
<42973632+kibanamachine@users.noreply.github.com>\nCo-authored-by: Aleh
Zasypkin <aleh.zasypkin@elastic.co>\nCo-authored-by: Faisal Kanout
<faisal.kanout@elastic.co>","sha":"64df229998b0db7e5d381c847e60c0d39e6c3120"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->
---------
Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Closes #179173.
Rule type
A dedicated stack rule type was created


datasetQuality.degradedDocs.This new rule is aggregated by default using
_indexand could be further configured by the user (e.g. user can also aggregate bycloud.provider).A new rule type was needed to be created since there is no actual way to aggregate all documents in a dataStream if we use a DataView like
logs-*-*. Inside datasStream documents there is no indication about the dataStream where they belong to, instead we just have_indexwhich contains backingIndexName instead of actual index.It's important to note, that this rule type is also visible from
Observability > Alerts, which is useful specially for serverless.Screen.Recording.2025-04-09.at.16.44.56.mov
Role Based Access-Control (RBAC)
RBAC for dataset quality alerts is defined within dataQuality kibana feature.
We have three privileges defined:
all: This privilege now contains a subFeaturemanage_rulesthat will allow for more granularity on alerting level. It's by default assigned toallbut can be disabled.read: This privilege is only related to serverless (when we don't have yet custom roles).https://github.com/user-attachments/assets/70ed5bde-bf45-4024-b448-228799fcaf71
none: This privilege is only relevant for stateful (in serverless we don't have custom roles).🎥 Demo
Serverless
allprivilegesScreen.Recording.2025-04-09.at.14.30.38.mov
readprivilegesScreen.Recording.2025-04-09.at.14.28.31.mov
Stateful
allprivilegesScreen.Recording.2025-04-09.at.15.01.24.mov
allprivileges with subFeature disabledScreen.Recording.2025-04-09.at.13.03.31.mov
noneprivileges (Stateful)Screen.Recording.2025-04-09.at.14.45.26.mov
How to test?
degraded_logsin live modesynth.3dataset (/app/management/data/data_quality/details?pageState=(dataStream:logs-synth.3-default)Actionsand then selectCreate ruleObservability > AlertsorStack management > Alerts(/app/observability/alerts)Release note
Adds the Create alert rule action to dataset quality page and dataset quality details. This allows you to generate an alert when the percentage of degraded docs on the chart crosses a certain threshold.