Skip to content

Commit

Permalink
[Uptime] Fixed metric query broken because of missing mapping (elasti…
Browse files Browse the repository at this point in the history
…c#68999)

Co-authored-by: Andrew Cholakian <andrew@andrewvc.com>
  • Loading branch information
shahzad31 and andrewvc committed Jun 12, 2020
1 parent 82a700e commit bf19cd2
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 bf19cd2

Please sign in to comment.