Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fleet] Add links to Discover in serverless when Logs UI not available #168349

Closed
juliaElastic opened this issue Oct 9, 2023 · 10 comments · Fixed by #171525
Closed

[Fleet] Add links to Discover in serverless when Logs UI not available #168349

juliaElastic opened this issue Oct 9, 2023 · 10 comments · Fixed by #171525
Assignees
Labels
Project:Serverless Work as part of the Serverless project for its initial release QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team

Comments

@juliaElastic
Copy link
Contributor

Follow up of #167304

It seem we are using Logs UI in a few more places in Fleet:
https://github.com/elastic/kibana/pull/168238/files?file-filters%5B%5D=.ts&file-filters%5B%5D=.tsx&owned-by%5B%5D=juliaElastic&show-viewed-files=true#diff-e337aa916d60d0d1033e3298c8c9c33c6a6fcd87a8ded971a4a87f5ccfc0981f

These should be replaced with links to Discover, similarly to how the link in Agent Details / Logs has been replaced.

@juliaElastic juliaElastic added the Team:Fleet Team label for Observability Data Collection Fleet team label Oct 9, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/fleet (Team:Fleet)

@ruflin
Copy link
Contributor

ruflin commented Oct 9, 2023

@weltenwort @tonyghiani The future on this is to open these links in Logs Explorer. The different solutions that embedded Logs ideally should not have to worry about where these link takes them. Can we add some logic to the button to make this seamless instead of changing links in many different places? It must also work in Security projects.

@jen-huang jen-huang added the Project:Serverless Work as part of the Serverless project for its initial release label Oct 31, 2023
@kpollich kpollich removed their assignment Nov 2, 2023
@kpollich kpollich added the QA:Needs Validation Issue needs to be validated by QA label Nov 8, 2023
@criamico criamico assigned criamico and unassigned juliaElastic Nov 15, 2023
@criamico
Copy link
Contributor

criamico commented Nov 16, 2023

In #167976 was introduced this check that show the Logs UI if available, otherwise the Discover one.

Do we want to replicate the same check on the other places or should they all go to Discover?

@criamico
Copy link
Contributor

I also saw that one of the existing links is only visible in some integrations (I could find Custom Logs for now:

Screenshot 2023-11-16 at 15 20 21

This link brings to /app/logs/stream, no filters or query are applied. Can we just replace it with a link to /app/discover?

@ruflin
Copy link
Contributor

ruflin commented Nov 20, 2023

Soon Logs Explorer becomes a tab in Discover: #171386 This hopefully solves the problem and we can always link to Logs Explorer. @weltenwort Do I miss something here?

pheyos pushed a commit to pheyos/kibana that referenced this issue Nov 21, 2023
…astic#171525)

Fixes elastic#168349

## Summary
Fix links to Logs view to point to Discover in Serverless.

As the Logs view UI is not available in serverless, the "Open in logs"
buttons should point to Discover instead. Rather than hardcode the url
in each of the places where is needed, I extracted a small component
that builds the two urls and allows switching in an easier way.
If in the future on of the two links will go away, it will be easier to
find those occurrences.

### Testing
Test for serverless following [these
instructions](elastic#167976)

**Error logs in agent activity flyout**
- Enroll an agent and try to cause some error - for instance upgrading
an agent that is not upgradeable
- Click on "Agent Activity" and find the error and a button besides it
- On stateful the button says "Open in Logs"

![Screenshot 2023-11-20 at 13 07
08](https://github.com/elastic/kibana/assets/16084106/704cf0e2-c7ee-4751-9e7f-7dcd263a5aa4)

- On serverless is "Open in discover"

![Screenshot 2023-11-20 at 13 08
02](https://github.com/elastic/kibana/assets/16084106/3902f09e-93dc-48d3-867e-1f80d977f437)

- Check that both show the same logs:

![Screenshot 2023-11-16 at 11 49
24](https://github.com/elastic/kibana/assets/16084106/d863d99f-0c70-45e5-9316-a37645464c34)
![Screenshot 2023-11-16 at 11 48
54](https://github.com/elastic/kibana/assets/16084106/7cbd0a5f-3b31-4c4d-a4b7-4eb7390983c8)


**Agent logs**
(Same test as above)
- Enroll an agent
- Click on the agent and go to the "Logs" tab
- On stateful the button says "Open in Logs"

![Screenshot 2023-11-20 at 13 04
41](https://github.com/elastic/kibana/assets/16084106/6a43a062-37db-47ea-819f-acd170439395)

- On serverless is "Open in discover"

![Screenshot 2023-11-20 at 13 04
11](https://github.com/elastic/kibana/assets/16084106/e15fdc8b-8780-4ac6-afc6-bff3d3a96be5)

- Check that both show the same logs

**Custom Logs UI**
There is also a link to logs on custom logs UI but I just linked to
discover for that one:
https://github.com/elastic/kibana/pull/171525/files#diff-e337aa916d60d0d1033e3298c8c9c33c6a6fcd87a8ded971a4a87f5ccfc0981fR20-R22

---------

Co-authored-by: Kibana Machine <[email protected]>
@weltenwort
Copy link
Member

Soon Logs Explorer becomes a tab in Discover: #171386 This hopefully solves the problem and we can always link to Logs Explorer. @weltenwort Do I miss something here?

The cause rather seems to be that the link to the old Logs UI was hard-coded. Instead the clean solution would be to check for and use the Log Explorer locators. (cc @mohamedhamed-ahmed)

@ruflin
Copy link
Contributor

ruflin commented Nov 23, 2023

@weltenwort Is this something we can contribute and then use as a reference for others to use?

@weltenwort
Copy link
Member

@mohamedhamed-ahmed I remember a related conversation about other places that link to the Log Stream or Logs UI. Did we already implement the locator that abstracts this away is is that still open?

@mohamedhamed-ahmed
Copy link
Contributor

mohamedhamed-ahmed commented Nov 27, 2023

@weltenwort At the moment we have locators dedicated for logs explorer and stream UI separately
the locator that is going to abstract this depending on what is being registered; on serverless, is still being implemented.
@awahab07 is working on it as part of this ticket

@amolnater-qasource
Copy link

Hi @criamico

We have revalidated these changes on latest 8.12 Serverless environment and found it working fine.

Observations:

  • Open in Discover button is available under Agent activity flyout for failed agents.
  • On clicking assets for Custom Logs user is navigated to Discover tab.
  • Under Agent logs tab, Open in Discover button is available.

Build details:
BUILD: 69401
COMMIT: f8e9923

Screen Recording:

Agents.-.Fleet.-.Elastic.-.Google.Chrome.2023-11-30.11-52-35.mp4

Hence we are marking this ticket as QA:Validated.

cc: @kpollich
Please let us know if anything else is required from our end.
Thanks!

@amolnater-qasource amolnater-qasource added QA:Validated Issue has been validated by QA and removed QA:Needs Validation Issue needs to be validated by QA labels Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Project:Serverless Work as part of the Serverless project for its initial release QA:Validated Issue has been validated by QA Team:Fleet Team label for Observability Data Collection Fleet team
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants