Skip to content

Commit

Permalink
[8.7] [Uptime] Add both both ip filters for view host in uptime locat…
Browse files Browse the repository at this point in the history
…ion for host and monitor (#155382) (#155399)

# Backport

This will backport the following commits from `main` to `8.7`:
- [Uptime] Add both both ip filters for view host in uptime location for
host and monitor (#155382) (c13a3ab)

<!--- Backport version: 8.9.7 -->

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

<!--BACKPORT
[{"author":{"name":"Shahzad","email":"shahzad31comp@gmail.com"},"sourceCommit":{"committedDate":"2023-04-20T13:17:09Z","message":"[Uptime]
Add both both ip filters for view host in uptime location for host and
monitor
(#155382)","sha":"c13a3ab603c51df0b36433e0e658ead0753bb9b8"},"sourceBranch":"main","suggestedTargetBranches":[],"targetPullRequestStates":[]}]
BACKPORT-->

Co-authored-by: Shahzad <shahzad31comp@gmail.com>
  • Loading branch information
kibanamachine and shahzad31 authored Apr 20, 2023
1 parent 4b99365 commit cad6f92
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ describe('uptimeOverviewNavigatorParams', () => {

it('creates a path with expected search when ip is specified', async () => {
const location = await uptimeOverviewNavigatorParams.getLocation({ ip: '127.0.0.1' });
expect(location.path).toEqual(`${OVERVIEW_ROUTE}?search=monitor.ip: "127.0.0.1"`);
expect(location.path).toEqual(
`${OVERVIEW_ROUTE}?search=host.ip: "127.0.0.1" OR monitor.ip: "127.0.0.1"`
);
});

it('creates a path with expected search when hostname is specified', async () => {
Expand All @@ -35,7 +37,7 @@ describe('uptimeOverviewNavigatorParams', () => {
ip: '127.0.0.1',
});
expect(location.path).toEqual(
`${OVERVIEW_ROUTE}?search=host.name: "elastic.co" OR host.ip: "127.0.0.1"`
`${OVERVIEW_ROUTE}?search=host.name: "elastic.co" OR host.ip: "127.0.0.1" OR monitor.ip: "127.0.0.1"`
);
});

Expand All @@ -45,7 +47,7 @@ describe('uptimeOverviewNavigatorParams', () => {
ip: '10.0.0.1',
});
expect(location.path).toEqual(
`${OVERVIEW_ROUTE}?search=kubernetes.pod.uid: "foo" OR monitor.ip: "10.0.0.1"`
`${OVERVIEW_ROUTE}?search=kubernetes.pod.uid: "foo" OR host.ip: "10.0.0.1" OR monitor.ip: "10.0.0.1"`
);
});

Expand Down
4 changes: 2 additions & 2 deletions x-pack/plugins/synthetics/public/apps/locators/overview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ async function navigate({
if (pod) searchParams.push(formatSearchKey('kubernetes.pod.uid', pod));

if (ip) {
const root = host ? 'host' : 'monitor';
searchParams.push(formatSearchKey(`${root}.ip`, ip));
searchParams.push(formatSearchKey(`host.ip`, ip));
searchParams.push(formatSearchKey(`monitor.ip`, ip));
}

const searchString = searchParams.join(' OR ');
Expand Down
6 changes: 5 additions & 1 deletion x-pack/plugins/synthetics/scripts/e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,8 @@ const path = require('path');

const e2eDir = path.join(__dirname, '../e2e');

executeSyntheticsRunner(e2eDir);
try {
executeSyntheticsRunner(e2eDir);
} catch (e) {
console.log(e);
}

0 comments on commit cad6f92

Please sign in to comment.