Skip to content

Conversation

@mohamedhamed-ahmed
Copy link
Contributor

@mohamedhamed-ahmed mohamedhamed-ahmed commented Jul 30, 2025

Fixes #229939

Summary

The Dataset Quality page was initially introduced with only logs signal type. Later on we introduced the ability to select more types, ex: metrics & traces.

Problem is that some places in the code were not updated to accommodate for this change and were kept under the assumption that the user will always have access to logs.

This led to a blocked user flow whenever the user has access to for example metrics but not logs and this PR fixes this.

💡 Solution

  • A new initial state machine state initializing has been introduced to lookup all privileges for the known signal types.

  • This state triggers either:

    1. emptyState --> when the user has no authorized signal types
    2. main --> old normal flow if the user has at least one authorized type
Screenshot 2025-07-30 at 12 20 37
  • The Types drop down is hidden if the user has only 1 authorized type
Screenshot 2025-07-30 at 13 24 22
  • The header message is updated to reflect the authorized signal types
Screenshot 2025-07-30 at 13 25 00
  • The user ends on an empty state page when no authorized types are available (Warning message udpated to be generic and not only about logs)
Screenshot 2025-07-30 at 12 21 03

🎥 Demo

Screen.Recording.2025-07-30.at.14.09.18.mov

@mohamedhamed-ahmed mohamedhamed-ahmed added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team Feature:Dataset Health backport:version Backport to applied version labels v9.1.0 v8.19.0 v8.18.0 labels Jul 30, 2025
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️

const { canUserMonitorAnyDataset, statsLoading } = useDatasetQualityState();

if (!canReadDataset) {
if (!statsLoading && !canUserMonitorAnyDataset) {
Copy link
Contributor

Choose a reason for hiding this comment

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

❤️ Thanks! this avoids the flickering

</EuiFlexItem>
)}
{!statsLoading && !canUserReadFailureStore && (
{!statsLoading && !canUserReadFailureStore && !noDatasetsAccess && (
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] the double negation here makes everything more complex to grasp

@yngrdyn
Copy link
Contributor

yngrdyn commented Jul 31, 2025

I skimmed quickly through the code, it looks good in general my only comment would be maybe to hide the alerts creation button when the user doesn't have any privileges over the data set types. wdyt?

@mohamedhamed-ahmed
Copy link
Contributor Author

I skimmed quickly through the code, it looks good in general my only comment would be maybe to hide the alerts creation button when the user doesn't have any privileges over the data set types. wdyt?

I think this makes sense since its useless for a use with no privileges at all 👍

@mohamedhamed-ahmed mohamedhamed-ahmed marked this pull request as ready for review July 31, 2025 12:39
@mohamedhamed-ahmed mohamedhamed-ahmed requested a review from a team as a code owner July 31, 2025 12:39
@elasticmachine
Copy link
Contributor

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

@yngrdyn
Copy link
Contributor

yngrdyn commented Aug 1, 2025

What do you think about adding some e2e tests for this PR?
It'd be nice if we could test the changes that trigger the errors initially, e.g a user without access to logs but with access to metrics

@mohamedhamed-ahmed
Copy link
Contributor Author

What do you think about adding some e2e tests for this PR? It'd be nice if we could test the changes that trigger the errors initially, e.g a user without access to logs but with access to metrics

Was already working on few tests as you put the comment :)

Copy link
Contributor

@yngrdyn yngrdyn left a comment

Choose a reason for hiding this comment

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

Great work 🚀
Thanks for addressing this issue

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
datasetQuality 819 818 -1

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
datasetQuality 31 33 +2

Async chunks

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

id before after diff
datasetQuality 418.9KB 421.2KB +2.3KB
Unknown metric groups

API count

id before after diff
datasetQuality 31 33 +2

History

@mohamedhamed-ahmed mohamedhamed-ahmed merged commit 96fd2e5 into elastic:main Aug 4, 2025
12 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19, 9.1

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

@kibanamachine
Copy link
Contributor

💔 All backports failed

Status Branch Result
8.19 Backport failed because of merge conflicts

You might need to backport the following PRs to 8.19:
- [ska] relocate dataset quality api-integration tests (#227826)
9.1 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.1:
- [Core] Unzyme src/core/packages/notifications :shipit: (#230255)
- [Obs AI Assistant] knowledge base UI works offline (#229874)
- Update dependency @launchdarkly/node-server-sdk to ^9.10.1 (main) (#230028)
- [ML] Remove annotations after Typescript upgrade 5.4.5 (#230181)
- [EDR Workflows] Initialize argument selector value (#227463)
- [Security Solution] Enable debug logging for Rule Management integration tests (#229185)

Manual backport

To create the backport manually run:

node scripts/backport --pr 229947

Questions ?

Please refer to the Backport tool documentation

mohamedhamed-ahmed added a commit to mohamedhamed-ahmed/kibana that referenced this pull request Aug 4, 2025
…9947)

Fixes elastic#229939

## Summary
The Dataset Quality page was initially introduced with only logs signal
type. Later on we introduced the ability to select more types, ex:
metrics & traces.

Problem is that some places in the code were not updated to accommodate
for this change and were kept under the assumption that the user will
always have access to logs.

This led to a blocked user flow whenever the user has access to for
example metrics but not logs and this PR fixes this.

## 💡 Solution

- **A new initial state machine state `initializing` has been introduced
to lookup all privileges for the known signal types**.
-  **This state triggers either**:

    1.  `emptyState` --> when the user has no authorized signal types
2. `main` --> old normal flow if the user has at least one authorized
type

<img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37"
src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba"
/>

---

- **The `Types` drop down is hidden if the user has only 1 authorized
type**

<img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22"
src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d"
/>

---

- **The header message is updated to reflect the authorized signal
types**

<img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00"
src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362"
/>

---

- **The user ends on an empty state page when no authorized types are
available (Warning message udpated to be generic and not only about
logs)**

<img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03"
src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6"
/>

## 🎥 Demo

https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
(cherry picked from commit 96fd2e5)

# Conflicts:
#	x-pack/platform/plugins/private/translations/translations/de-DE.json
@mohamedhamed-ahmed
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1
8.19

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

Questions ?

Please refer to the Backport tool documentation

mohamedhamed-ahmed added a commit to mohamedhamed-ahmed/kibana that referenced this pull request Aug 4, 2025
…9947)

Fixes elastic#229939

## Summary
The Dataset Quality page was initially introduced with only logs signal
type. Later on we introduced the ability to select more types, ex:
metrics & traces.

Problem is that some places in the code were not updated to accommodate
for this change and were kept under the assumption that the user will
always have access to logs.

This led to a blocked user flow whenever the user has access to for
example metrics but not logs and this PR fixes this.

## 💡 Solution

- **A new initial state machine state `initializing` has been introduced
to lookup all privileges for the known signal types**.
-  **This state triggers either**:

    1.  `emptyState` --> when the user has no authorized signal types
2. `main` --> old normal flow if the user has at least one authorized
type

<img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37"
src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba"
/>

---

- **The `Types` drop down is hidden if the user has only 1 authorized
type**

<img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22"
src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d"
/>

---

- **The header message is updated to reflect the authorized signal
types**

<img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00"
src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362"
/>

---

- **The user ends on an empty state page when no authorized types are
available (Warning message udpated to be generic and not only about
logs)**

<img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03"
src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6"
/>

## 🎥 Demo

https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
(cherry picked from commit 96fd2e5)

# Conflicts:
#	x-pack/platform/plugins/private/translations/translations/de-DE.json
#	x-pack/platform/plugins/shared/dataset_quality/public/components/dataset_quality/filters/filters.tsx
#	x-pack/platform/plugins/shared/dataset_quality/public/components/dataset_quality/header.tsx
#	x-pack/platform/plugins/shared/dataset_quality/public/hooks/use_dataset_quality_filters.ts
#	x-pack/platform/plugins/shared/dataset_quality/public/state_machines/dataset_quality_controller/src/state_machine.ts
#	x-pack/solutions/observability/test/functional/page_objects/dataset_quality.ts
#	x-pack/test/dataset_quality_api_integration/tests/data_streams/stats.spec.ts
#	x-pack/test/dataset_quality_api_integration/tests/data_streams/types_privileges.spec.ts
szaffarano pushed a commit to szaffarano/kibana that referenced this pull request Aug 5, 2025
…9947)

Fixes elastic#229939

## Summary 
The Dataset Quality page was initially introduced with only logs signal
type. Later on we introduced the ability to select more types, ex:
metrics & traces.

Problem is that some places in the code were not updated to accommodate
for this change and were kept under the assumption that the user will
always have access to logs.

This led to a blocked user flow whenever the user has access to for
example metrics but not logs and this PR fixes this.

## 💡 Solution

- **A new initial state machine state `initializing` has been introduced
to lookup all privileges for the known signal types**.
-  **This state triggers either**:

    1.  `emptyState` --> when the user has no authorized signal types 
2. `main` --> old normal flow if the user has at least one authorized
type

<img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37"
src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba"
/>

---

- **The `Types` drop down is hidden if the user has only 1 authorized
type**

<img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22"
src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d"
/>

---

- **The header message is updated to reflect the authorized signal
types**

<img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00"
src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362"
/>

---

- **The user ends on an empty state page when no authorized types are
available (Warning message udpated to be generic and not only about
logs)**

<img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03"
src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6"
/>

## 🎥 Demo



https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
mohamedhamed-ahmed added a commit that referenced this pull request Aug 5, 2025
…9947) (#230394)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Dataset Quality] Missing logs privilege blocks user flow
(#229947)](#229947)

<!--- Backport version: 10.0.1 -->

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

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
@kibanamachine kibanamachine added the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 5, 2025
@kibanamachine
Copy link
Contributor

Looks like this PR has backport PRs but they still haven't been merged. Please merge them ASAP to keep the branches relatively in sync.
cc: @mohamedhamed-ahmed

mohamedhamed-ahmed added a commit that referenced this pull request Aug 5, 2025
) (#230389)

# Backport

This will backport the following commits from `main` to `9.1`:
- [[Dataset Quality] Missing logs privilege blocks user flow
(#229947)](#229947)

<!--- Backport version: 10.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)
@kibanamachine kibanamachine removed the backport missing Added to PRs automatically when the are determined to be missing a backport. label Aug 5, 2025
delanni pushed a commit to delanni/kibana that referenced this pull request Aug 5, 2025
…9947)

Fixes elastic#229939

## Summary 
The Dataset Quality page was initially introduced with only logs signal
type. Later on we introduced the ability to select more types, ex:
metrics & traces.

Problem is that some places in the code were not updated to accommodate
for this change and were kept under the assumption that the user will
always have access to logs.

This led to a blocked user flow whenever the user has access to for
example metrics but not logs and this PR fixes this.

## 💡 Solution

- **A new initial state machine state `initializing` has been introduced
to lookup all privileges for the known signal types**.
-  **This state triggers either**:

    1.  `emptyState` --> when the user has no authorized signal types 
2. `main` --> old normal flow if the user has at least one authorized
type

<img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37"
src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba"
/>

---

- **The `Types` drop down is hidden if the user has only 1 authorized
type**

<img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22"
src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d"
/>

---

- **The header message is updated to reflect the authorized signal
types**

<img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00"
src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362"
/>

---

- **The user ends on an empty state page when no authorized types are
available (Warning message udpated to be generic and not only about
logs)**

<img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03"
src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6"
/>

## 🎥 Demo



https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
@wildemat wildemat mentioned this pull request Aug 7, 2025
10 tasks
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Aug 18, 2025
…9947)

Fixes elastic#229939

## Summary 
The Dataset Quality page was initially introduced with only logs signal
type. Later on we introduced the ability to select more types, ex:
metrics & traces.

Problem is that some places in the code were not updated to accommodate
for this change and were kept under the assumption that the user will
always have access to logs.

This led to a blocked user flow whenever the user has access to for
example metrics but not logs and this PR fixes this.

## 💡 Solution

- **A new initial state machine state `initializing` has been introduced
to lookup all privileges for the known signal types**.
-  **This state triggers either**:

    1.  `emptyState` --> when the user has no authorized signal types 
2. `main` --> old normal flow if the user has at least one authorized
type

<img width="1239" height="527" alt="Screenshot 2025-07-30 at 12 20 37"
src="https://github.com/user-attachments/assets/75f96cc4-bbe2-4295-9ff6-6ab85b85e9ba"
/>

---

- **The `Types` drop down is hidden if the user has only 1 authorized
type**

<img width="747" height="111" alt="Screenshot 2025-07-30 at 13 24 22"
src="https://github.com/user-attachments/assets/a6107275-57d7-44f6-ac88-069800c3e58d"
/>

---

- **The header message is updated to reflect the authorized signal
types**

<img width="839" height="126" alt="Screenshot 2025-07-30 at 13 25 00"
src="https://github.com/user-attachments/assets/a56bdb76-6c5e-4bf7-8467-07f77c9b6362"
/>

---

- **The user ends on an empty state page when no authorized types are
available (Warning message udpated to be generic and not only about
logs)**

<img width="1721" height="836" alt="Screenshot 2025-07-30 at 12 21 03"
src="https://github.com/user-attachments/assets/62d3ed5f-3527-4f11-9436-46815f7303e6"
/>

## 🎥 Demo



https://github.com/user-attachments/assets/05db6626-b4d9-4903-b398-a674562dc6de
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 Feature:Dataset Health release_note:skip Skip the PR/issue when compiling release notes Team:obs-onboarding Observability Onboarding Team v8.19.2 v9.1.2 v9.2.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🐞 [Dataset Quality] Missing logs privilege blocks user flow

5 participants