Skip to content

Commit

Permalink
[eem] fix builtin definition metrics (elastic#189065)
Browse files Browse the repository at this point in the history
Closes elastic#188769
Closes elastic#188765

Fixes the throughput and failedTransactionRate that were not correctly
computed
  • Loading branch information
klacabane authored Jul 25, 2024
1 parent 67b8d98 commit 76237d8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions x-pack/packages/kbn-entities-schema/src/schema/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export enum BasicAggregations {
max = 'max',
min = 'min',
sum = 'sum',
value_count = 'value_count',
cardinality = 'cardinality',
last_value = 'last_value',
std_deviation = 'std_deviation',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,27 @@ export const builtInServicesFromLogsEntityDefinition: EntityDefinition =
metrics: [
{
name: 'A',
aggregation: 'doc_count',
aggregation: 'value_count',
filter: serviceTransactionFilter(),
field: 'transaction.duration.summary',
},
],
},
{
name: 'failedTransactionRate',
equation: 'A / B',
equation: '1 - (A / B)',
metrics: [
{
name: 'A',
aggregation: 'doc_count',
filter: serviceTransactionFilter(['event.outcome: "failure"']),
aggregation: 'sum',
filter: serviceTransactionFilter(),
field: 'event.success_count',
},
{
name: 'B',
aggregation: 'doc_count',
filter: serviceTransactionFilter(['event.outcome: *']),
aggregation: 'value_count',
filter: serviceTransactionFilter(),
field: 'event.success_count',
},
],
},
Expand Down

0 comments on commit 76237d8

Please sign in to comment.