-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[APM] Use the outcome field to calculate the transaction error rate chart #75528
Merged
cauemarcondes
merged 16 commits into
elastic:master
from
cauemarcondes:apm-error-rate-outcome
Sep 7, 2020
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d39b494
replacing error rate to use event.outcome field
cauemarcondes 4897424
Merge branch 'master' of github.com:elastic/kibana into apm-error-rat…
cauemarcondes 1be58f1
addressing PR comment
cauemarcondes 6db831a
Merge branch 'master' into apm-error-rate-outcome
elasticmachine e565152
Merge branch 'master' into apm-error-rate-outcome
elasticmachine 1399d86
fixing api test
cauemarcondes e67cac5
Merge branch 'apm-error-rate-outcome' of github.com:cauemarcondes/kib…
cauemarcondes 817f47a
fixing API test
cauemarcondes de9b914
Merge branch 'master' of github.com:elastic/kibana into apm-error-rat…
cauemarcondes 5f064ee
Merge branch 'master' into apm-error-rate-outcome
elasticmachine ade9e9e
Merge branch 'master' into apm-error-rate-outcome
elasticmachine 44f69d9
Merge branch 'master' of github.com:elastic/kibana into apm-error-rat…
cauemarcondes f459501
fixing api tests
cauemarcondes 2d73328
rmeoving snapshot from api test
cauemarcondes e9b9642
testing error rate
cauemarcondes 73cd059
Merge branch 'master' into apm-error-rate-outcome
elasticmachine File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
6 changes: 6 additions & 0 deletions
6
x-pack/plugins/apm/common/__snapshots__/elasticsearch_fieldnames.test.ts.snap
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export enum EventOutcome { | ||
success = 'success', | ||
failure = 'failure', | ||
unknown = 'unknown', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
+1.24 MB
(770%)
x-pack/test/apm_api_integration/basic/fixtures/es_archiver/8.0.0/data.json.gz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO this is not really helpful. Can we avoid a snapshot test? e.g. we can count the buckets, or compare the avg only, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree, we should spent a little more time finding the right things to test instead of blindly testing the full output (I've been very guilty of this myself). Testing the entire output like this makes the test prone to false positives, where it fails when new properties are added, which leads us to blindly updating it when the implementation changes, thus bugs can creep in.
The challenge by NOT doing snapshot testing is that we don't have as good coverage and bugs can creep in...
I tried to think of the important things to verify, while still making it flexible enough to allow a developer to change the implementation (eg. add new properties).
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like what you suggested @sqren, but I feel that in the test scenarios you described above we are not testing what really matters for the API, that is the error rate. The average is not calculated in ES, it also uses lodash mean, so even if we change the way we calculate the error rate these tests will never fail.
I agree that we should avoid snapshot tests, but in the end, we are testing the return of an API and we must find a balance between these two approaches.