mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 09:19:04 -04:00
Always use summary events for monitor info (#82376)
* Always use summary events for monitor info Fixes https://github.com/elastic/kibana/issues/81942 With synthetics we no longer are guaranteed to have the URL or other monitor info fields in every single event. This PR patches the monitor status API to only query summary fields for this info. As an added benefit, this is a bit more consistent as well because we tend to only show data from completed, not partial checks, in most places. This also removes the status check parameter from this API, which otherwise would need to be refactored. Checking the codebase it appears unused. * Remove unneeded params
This commit is contained in:
parent
5b6e94bbad
commit
e94db6329d
2 changed files with 6 additions and 4 deletions
|
@ -17,6 +17,11 @@ describe('getLatestMonitor', () => {
|
|||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{
|
||||
exists: {
|
||||
field: 'summary',
|
||||
},
|
||||
},
|
||||
{
|
||||
range: {
|
||||
'@timestamp': {
|
||||
|
|
|
@ -18,8 +18,6 @@ export interface GetLatestMonitorParams {
|
|||
monitorId?: string | null;
|
||||
|
||||
observerLocation?: string;
|
||||
|
||||
status?: string;
|
||||
}
|
||||
|
||||
// Get The monitor latest state sorted by timestamp with date range
|
||||
|
@ -30,7 +28,6 @@ export const getLatestMonitor: UMElasticsearchQueryFn<GetLatestMonitorParams, Pi
|
|||
dateEnd,
|
||||
monitorId,
|
||||
observerLocation,
|
||||
status,
|
||||
}) => {
|
||||
const params = {
|
||||
index: dynamicSettings.heartbeatIndices,
|
||||
|
@ -38,6 +35,7 @@ export const getLatestMonitor: UMElasticsearchQueryFn<GetLatestMonitorParams, Pi
|
|||
query: {
|
||||
bool: {
|
||||
filter: [
|
||||
{ exists: { field: 'summary' } },
|
||||
{
|
||||
range: {
|
||||
'@timestamp': {
|
||||
|
@ -46,7 +44,6 @@ export const getLatestMonitor: UMElasticsearchQueryFn<GetLatestMonitorParams, Pi
|
|||
},
|
||||
},
|
||||
},
|
||||
...(status ? [{ term: { 'monitor.status': status } }] : []),
|
||||
...(monitorId ? [{ term: { 'monitor.id': monitorId } }] : []),
|
||||
...(observerLocation ? [{ term: { 'observer.geo.name': observerLocation } }] : []),
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue