Skip to content

Conversation

@rStelmach
Copy link
Contributor

@rStelmach rStelmach commented May 8, 2025

Because Data Set quality page does not currently work with CCS, logs coming from remote cluster have dataset quality link hidden in the flyout.

The fix would hide a Data Set Quality link for documents that are coming from remote clusters

Fixes #211602

@rStelmach rStelmach marked this pull request as ready for review May 20, 2025 11:20
@rStelmach rStelmach requested a review from a team as a code owner May 20, 2025 11:20
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
@rStelmach rStelmach added bug Fixes for quality problems that affect the customer experience Feature:Dataset Health labels May 20, 2025
@rStelmach rStelmach changed the title Hide Data set details when dataStream is coming from remote cluster [Data Set Quality] Hide Data set details when dataStream is coming from remote cluster May 20, 2025
@elastic-vault-github-plugin-prod elastic-vault-github-plugin-prod bot requested a review from a team as a code owner May 20, 2025 11:37
prefix: qualityIssuesAccordionTitle,
});

const isCCSRemoteIndex = isCCSRemoteIndexName(rawDoc._index ?? '');
Copy link
Contributor

Choose a reason for hiding this comment

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

QQ: Just curious if the _index can actually really be undefined? and do we want to display the Dataset Quality link in this case or not?

Copy link
Contributor

Choose a reason for hiding this comment

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

I can answer this from the Discover side, yes it can be for ES|QL mode if METADATA _index isn't used in the query. Although I'm not sure if the logs profile is currently showing the degraded fields section in ES|QL mode yet.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In DatasetQualityLink there is a line that would hide the link when dataStream is empty:
if (!locator || !dataStream) return null;
I think that if _index would be empty, the dataStream should be too ( correct me if I'm wrong)
If somehow dataStream would be present but _index wouldn't, the link itself would still work properly.

@gbamparop
Copy link
Contributor

gbamparop commented May 21, 2025

I've noticed some issues, but they are not related to this PR:

  1. k8s.pod.ip and resource.attributes.k8s.pod.ip are displayed in the quality section as ignore fields, but only resource.attributes.k8s.pod.ip seems to be _ignored based on the doc.
  2. The value of these fields in the data set quality section is empty, however, in the actual doc it's 0.0.0.0

You can check the doc in the release-oblt cluster.

Screen.Recording.2025-05-21.at.09.09.47.mov

@gbamparop
Copy link
Contributor

gbamparop commented May 21, 2025

  • k8s.pod.ip and resource.attributes.k8s.pod.ip are displayed in the quality section as ignore fields, but only resource.attributes.k8s.pod.ip seems to be _ignored based on the doc.

Actually they both appear as empty in the ignored_field_values section. @flash1293 do you know why this might be happening?

…vigating-to-the-data-set-details-page-for-a-remote-data-stream
Copy link
Member

@kertal kertal left a comment

Choose a reason for hiding this comment

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

While the code change LGTM, could you provide a bit more context, is this resolving an issue? it's labeled as bug, but this would be more suitable as a fix. And this should also be described in the PR description. Also a unit test would be great to cover it, thx 👍

@rStelmach
Copy link
Contributor Author

@kertal

While the code change LGTM, could you provide a bit more context, is this resolving an issue? it's labeled as bug, but this would be more suitable as a fix. And this should also be described in the PR description. Also a unit test would be great to cover it, thx 👍

Hi, you are right. So the context is that now CCS clusters do not work with Dataset Quality (and for now there aren't any plans to change it). When you click that link it would take you to the page and it will result with an error. So for the logs that are coming from remote cluster we want to hide the link to dataset quality in the flyout.

I also added two tests to make sure it would work properly

rStelmach added 2 commits May 29, 2025 15:34
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
@kertal kertal requested a review from a team June 3, 2025 14:34
@rStelmach rStelmach added the Team:obs-onboarding Observability Onboarding Team label Jun 4, 2025
@elasticmachine
Copy link
Contributor

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

@rStelmach rStelmach removed the bug Fixes for quality problems that affect the customer experience label Jun 4, 2025
Comment on lines 259 to 261
const hitWithDataStream = buildHit({});

hitWithDataStream.raw.fields = sourceFields;
Copy link
Contributor

Choose a reason for hiding this comment

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

q: is it possible to do something like const hitWithDataStream = buildHit(sourceFields);?


const accordions = screen.getAllByTestId('unifiedDocViewLogsOverviewDegradedFieldsAccordion');
const accordion = accordions[accordions.length - 1];
const button = accordion.querySelector('button');
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do within(accordion).getByRole('button')?

const accordion = accordions[accordions.length - 1];
const button = accordion.querySelector('button');

if (button) {
Copy link
Contributor

Choose a reason for hiding this comment

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

is the button not always there or is this just to appease the type checking?

Comment on lines 281 to 283
act(() => {
button.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do something like

const user = userEvent.setup();
await user.click(button)

Comment on lines 300 to 303
const remoteHit = buildHit({});

remoteHit.raw.fields = sourceFields;
remoteHit.raw._index = `remoteCluster:${DATA_STREAM_NAME}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

same as before, is it possible to do buildHit(sourceFields) and maybe extend that mock factory to also take the index?

Copy link
Contributor

@AlexGPlay AlexGPlay left a comment

Choose a reason for hiding this comment

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

left some comments around testing - is it possible to somehow test this manually?

@rStelmach
Copy link
Contributor Author

rStelmach commented Jun 4, 2025

@AlexGPlay

Thank you for the review.
If you wanted to test it manually, you would have to :

  1. Create through oblt a cluster and ingest some degraded or failed documents with synthrace (example command : node scripts/synthtrace degraded_logs.ts --target=https://elastic:M52oBciCkgNU9KJV9dnKiZAz@main-edge-oblt -ccs-r-wydbn.es.us-west2.gcp.elastic-cloud.com:443 --kibana=http://elastic:M52oBciCkgNU9KJV9dnKiZAz@localhost:5601)
  2. Create another cluster with oblt ( best way is to do this through command in slack /create-ccs-cluster) and point that cluster to the one you have just created and ingested docs.
  3. In the second cluster that is remotely connected create a dataview remote_cluster:* and pick a document like in the issue description video ( [Data Set Quality] 🐞 Error thrown when navigating to the Data Set details page for a remote data stream #211602 ) and in the flyout you should/shouldn't be able to see the Dataset Quality Link

Let me know if anything is unclear!

rStelmach and others added 2 commits June 4, 2025 16:56
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
Comment on lines 267 to 273
const accordions = screen.getAllByTestId('unifiedDocViewLogsOverviewDegradedFieldsAccordion');
const accordion = accordions[accordions.length - 1];
const button = accordion.querySelector('button');

if (button === null) {
return;
}
// Check the aria-expanded property of the button
const isExpanded = button.getAttribute('aria-expanded');
expect(isExpanded).toBe('false');
act(() => {
button?.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

can we do the same we did for the other test here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@AlexGPlay I updated all buttons in that test file so now it should be consistent

Comment on lines 304 to 310
const accordions = screen.getAllByTestId('unifiedDocViewLogsOverviewDegradedFieldsAccordion');
const accordion = accordions[accordions.length - 1];
const button = accordion.querySelector('button');

act(() => {
button?.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

same here please 🙏

Comment on lines 271 to 273
act(() => {
button?.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
act(() => {
button?.click();
});
const user = userEvent.setup();
await user.click(button);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh you meant those changes 😄
Got it now

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah, no worries, other than this i think it looks good

Comment on lines 308 to 310
act(() => {
button?.click();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
act(() => {
button?.click();
});
const user = userEvent.setup();
await user.click(button);

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right now it should be ok

Copy link
Contributor

@AlexGPlay AlexGPlay left a comment

Choose a reason for hiding this comment

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

thank you for taking your time getting the tests to a better state 😄

rStelmach added 3 commits June 6, 2025 12:26
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
…vigating-to-the-data-set-details-page-for-a-remote-data-stream
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

Async chunks

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

id before after diff
unifiedDocViewer 220.2KB 220.3KB +95.0B

History

@yngrdyn
Copy link
Contributor

yngrdyn commented Jun 10, 2025

/oblt-deploy

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.

LGTM, I tested the changes and the link is hidden when we are checking a log coming from a remote cluster and is shown when the log is local

Screen.Recording.2025-06-11.at.11.18.00.mov

@rStelmach rStelmach merged commit fa400a4 into elastic:main Jun 11, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

kibanamachine added a commit to kibanamachine/kibana that referenced this pull request Jun 11, 2025
…om remote cluster (elastic#220529)

Because Data Set quality page does not currently work with CCS, logs
coming from remote cluster have dataset quality link hidden in the
flyout.

The fix would hide a Data Set Quality link for documents that are coming
from remote clusters

Fixes elastic#211602

---------

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit fa400a4)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

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

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 11, 2025
…ming from remote cluster (#220529) (#223376)

# Backport

This will backport the following commits from `main` to `8.19`:
- [[Data Set Quality] Hide Data set details when dataStream is coming
from remote cluster
(#220529)](#220529)

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

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

<!--BACKPORT [{"author":{"name":"Robert
Stelmach","email":"[email protected]"},"sourceCommit":{"committedDate":"2025-06-11T09:19:51Z","message":"[Data
Set Quality] Hide Data set details when dataStream is coming from remote
cluster (#220529)\n\nBecause Data Set quality page does not currently
work with CCS, logs\ncoming from remote cluster have dataset quality
link hidden in the\nflyout.\n\nThe fix would hide a Data Set Quality
link for documents that are coming\nfrom remote clusters\n\nFixes
#211602\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"fa400a4ebb984a05f8f3f0b73c8901e33d8877d2","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:fix","Team:obs-ux-logs","Feature:Dataset
Health","backport:version","v9.1.0","v8.19.0"],"title":"[Data Set
Quality] Hide Data set details when dataStream is coming from remote
cluster","number":220529,"url":"https://github.com/elastic/kibana/pull/220529","mergeCommit":{"message":"[Data
Set Quality] Hide Data set details when dataStream is coming from remote
cluster (#220529)\n\nBecause Data Set quality page does not currently
work with CCS, logs\ncoming from remote cluster have dataset quality
link hidden in the\nflyout.\n\nThe fix would hide a Data Set Quality
link for documents that are coming\nfrom remote clusters\n\nFixes
#211602\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"fa400a4ebb984a05f8f3f0b73c8901e33d8877d2"}},"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/220529","number":220529,"mergeCommit":{"message":"[Data
Set Quality] Hide Data set details when dataStream is coming from remote
cluster (#220529)\n\nBecause Data Set quality page does not currently
work with CCS, logs\ncoming from remote cluster have dataset quality
link hidden in the\nflyout.\n\nThe fix would hide a Data Set Quality
link for documents that are coming\nfrom remote clusters\n\nFixes
#211602\n\n---------\n\nCo-authored-by: kibanamachine
<[email protected]>","sha":"fa400a4ebb984a05f8f3f0b73c8901e33d8877d2"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Robert Stelmach <[email protected]>
nickpeihl pushed a commit to nickpeihl/kibana that referenced this pull request Jun 12, 2025
…om remote cluster (elastic#220529)

Because Data Set quality page does not currently work with CCS, logs
coming from remote cluster have dataset quality link hidden in the
flyout.

The fix would hide a Data Set Quality link for documents that are coming
from remote clusters

Fixes elastic#211602

---------

Co-authored-by: kibanamachine <[email protected]>
iblancof pushed a commit to iblancof/kibana that referenced this pull request Jun 16, 2025
…om remote cluster (elastic#220529)

Because Data Set quality page does not currently work with CCS, logs
coming from remote cluster have dataset quality link hidden in the
flyout.

The fix would hide a Data Set Quality link for documents that are coming
from remote clusters

Fixes elastic#211602

---------

Co-authored-by: kibanamachine <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Data Set Quality] 🐞 Error thrown when navigating to the Data Set details page for a remote data stream

9 participants