Skip to content
This repository has been archived by the owner on Mar 31, 2024. It is now read-only.

Commit

Permalink
[APM] Services without application metrics display an error (elastic#…
Browse files Browse the repository at this point in the history
…131347) (elastic#131429)

(cherry picked from commit ec152a6)

Co-authored-by: Cauê Marcondes <55978943+cauemarcondes@users.noreply.github.com>
  • Loading branch information
kibanamachine and cauemarcondes authored May 3, 2022
1 parent f536ca0 commit a2f7bab
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,16 @@ const chartBase: ChartBase = {
};

export const percentSystemMemoryUsedScript = {
lang: 'expression',
source: `1 - doc['${METRIC_SYSTEM_FREE_MEMORY}'] / doc['${METRIC_SYSTEM_TOTAL_MEMORY}']`,
lang: 'painless',
source: `
if(doc.containsKey('${METRIC_SYSTEM_FREE_MEMORY}') && doc.containsKey('${METRIC_SYSTEM_TOTAL_MEMORY}')){
double freeMemoryValue = doc['${METRIC_SYSTEM_FREE_MEMORY}'].value;
double totalMemoryValue = doc['${METRIC_SYSTEM_TOTAL_MEMORY}'].value;
return 1 - freeMemoryValue / totalMemoryValue
}
return null;
`,
} as const;

export const percentCgroupMemoryUsedScript = {
Expand Down

0 comments on commit a2f7bab

Please sign in to comment.