Skip to content

Commit

Permalink
[Infra] Add the logs tab to container views (elastic#184854)
Browse files Browse the repository at this point in the history
Closes elastic#184770 

## Summary

This PR adds the logs tab to container views.

### Testing

- Enable Container view from Infra settings
- Go to Inventory and select Docker Containers from the "Show" drop-down
- Click on a container
   - The logs tab should be visible 
- Click on the Logs tab
- The search functionality and the link (with the filter) should work


![image](https://github.com/elastic/kibana/assets/14139027/c0720a47-50e5-4244-9f50-53882fc5ed53)

- Click on "Open as Page"
   - The logs tab should be visible 
- The search functionality and the link (with the filter) should work

<img width="1717" alt="image"
src="https://github.com/elastic/kibana/assets/14139027/90161dd7-ae66-4274-bc99-39e4c9233fa7">



https://github.com/elastic/kibana/assets/14139027/0ce5761c-cc39-4d55-87ba-a6c12cc7315c

- ⚠️ If some of the containers on the edge cluster don't have logs in
the logs settings the `container.id` can be added and used in inventory
to find a container with logs ( This should be added for the docker
containers on edge soon - for now it can be checked for a non-docker
container )


![image](https://github.com/elastic/kibana/assets/14139027/90d7f0e4-384d-4cc8-aea0-6ff10713450d)

Example with a container id (with logs)


![image](https://github.com/elastic/kibana/assets/14139027/162f37ce-8ba8-4c8d-835d-f2d23c3bc0ec)
  • Loading branch information
jennypavlova authored Jun 10, 2024
1 parent b1ff240 commit 2d3dc3f
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@ export const hostDetailsTabs: Tab[] = [
];
export const hostDetailsFlyoutTabs: Tab[] = [...hostDetailsTabs, linkToApmTab];

// Profiling and Logs tab would be added in next iteration
export const containerDetailsTabs: Tab[] = [overviewTab, metadataTab];
export const containerDetailsFlyoutTabs: Tab[] = [overviewTab, metadataTab, linkToApmTab];
// The profiling tab would be added in next iteration
export const containerDetailsTabs: Tab[] = [overviewTab, metadataTab, logsTab];
export const containerDetailsFlyoutTabs: Tab[] = [overviewTab, metadataTab, logsTab, linkToApmTab];

export const getAssetDetailsTabs = (type: string): Tab[] => {
switch (type) {
Expand Down
16 changes: 16 additions & 0 deletions x-pack/test/functional/apps/infra/home_page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,22 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
});
});

describe('Logs Tab', () => {
before(async () => {
await pageObjects.assetDetails.clickLogsTab();
});

after(async () => {
await retry.try(async () => {
await pageObjects.infraHome.closeFlyout();
});
});

it('should render logs tab', async () => {
await pageObjects.assetDetails.logsExists();
});
});

describe('APM Link Tab', () => {
before(async () => {
await pageObjects.infraHome.clickOnNode();
Expand Down
23 changes: 23 additions & 0 deletions x-pack/test/functional/apps/infra/node_details.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,29 @@ export default ({ getPageObjects, getService }: FtrProviderContext) => {
expect(charts.length).to.equal(chartsCount);
});
});
describe('Logs Tab', () => {
before(async () => {
await pageObjects.assetDetails.clickLogsTab();
});

it('should render logs tab', async () => {
await pageObjects.assetDetails.logsExists();
});

it('preserves search term between page reloads', async () => {
const searchInput = await pageObjects.assetDetails.getLogsSearchField();

expect(await searchInput.getAttribute('value')).to.be('');

await searchInput.type('test');
await refreshPageWithDelay();

await retry.try(async () => {
expect(await searchInput.getAttribute('value')).to.be('test');
});
await searchInput.clearValue();
});
});
});
});
});
Expand Down

0 comments on commit 2d3dc3f

Please sign in to comment.