Skip to content

Commit

Permalink
[Uptime] Fixed metric query broken because of missing mapping (#68999)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Cholakian <[email protected]>
  • Loading branch information
shahzad31 and andrewvc authored Jun 12, 2020
1 parent de8714d commit f8cad12
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ describe('getLatestMonitor', () => {
'monitor',
'observer',
'@timestamp',
'tls.server.x509.not_after',
'tls.server.x509.not_before',
'tls.certificate_not_valid_after',
'tls.certificate_not_valid_before',
],
sort: {
'@timestamp': { order: 'desc' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ export const getLatestMonitor: UMElasticsearchQueryFn<GetLatestMonitorParams, Pi
'monitor',
'observer',
'@timestamp',
'tls.server.x509.not_after',
'tls.server.x509.not_before',
'tls.certificate_not_valid_after',
'tls.certificate_not_valid_before',
],
sort: {
'@timestamp': { order: 'desc' },
Expand All @@ -68,6 +68,9 @@ export const getLatestMonitor: UMElasticsearchQueryFn<GetLatestMonitorParams, Pi
...ping,
docId,
timestamp: ping['@timestamp'],
tls: { not_after: tls?.server?.x509?.not_after, not_before: tls?.server?.x509?.not_before },
tls: {
not_after: tls?.certificate_not_valid_after,
not_before: tls?.certificate_not_valid_before,
},
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,11 @@ export const enrichMonitorGroups: MonitorEnricher = async (
if (curCheck.tls == null) {
curCheck.tls = new HashMap();
}
if (!doc["tls.server.x509.not_after"].isEmpty()) {
curCheck.tls.not_after = doc["tls.server.x509.not_after"][0];
if (!doc["tls.certificate_not_valid_after"].isEmpty()) {
curCheck.tls.not_after = doc["tls.certificate_not_valid_after"][0];
}
if (!doc["tls.server.x509.not_before"].isEmpty()) {
curCheck.tls.not_before = doc["tls.server.x509.not_before"][0];
if (!doc["tls.certificate_not_valid_before"].isEmpty()) {
curCheck.tls.not_before = doc["tls.certificate_not_valid_before"][0];
}
state.checksByAgentIdIP[agentIdIP] = curCheck;
Expand Down

0 comments on commit f8cad12

Please sign in to comment.