Skip to content
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] Add transaction name filter in failed transaction rate rule type #155405

Merged

Conversation

kpatticha
Copy link
Contributor

@kpatticha kpatticha commented Apr 20, 2023

part of #152329
related work #154241

Introduces the Transaction name filter in the failed transaction rate rule type

Screen.Recording.2023-04-20.at.15.38.45.mov

Fixes

The regression introduces in a previous PR

Existing rule types can have empty string in their params so we need to make sure we don't filter empty values as it will yield no results.

@kpatticha kpatticha requested a review from a team as a code owner April 20, 2023 13:45
@botelastic botelastic bot added the Team:APM All issues that need APM UI Team support label Apr 20, 2023
@elasticmachine
Copy link
Contributor

Pinging @elastic/apm-ui (Team:APM)

@apmmachine
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • /oblt-deploy : Deploy a Kibana instance using the Observability test environments.
  • run elasticsearch-ci/docs : Re-trigger the docs validation. (use unformatted text in the comment!)

@@ -102,7 +106,8 @@ export function TransactionErrorRateRuleType(props: Props) {
onChange={(value) => {
if (value !== params.serviceName) {
setRuleParams('serviceName', value);
setRuleParams('transactionType', '');
setRuleParams('transactionType', undefined);
Copy link
Member

@sorenlouv sorenlouv Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was this mistakenly set to an empty string? What's the impact of this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I'm also wondering what this means for eg updating existing rules?

Copy link
Contributor Author

@kpatticha kpatticha Apr 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was added here: ad75d90 to reset the values when changing the service name but imo sending an empty string can lead to misleading results.

As for updating an existing rule, it will remove transactionType param from the list and it won't filter for the transaction.type

However, the biggest impact seems to be in the rule executor. Existing rules may have filter fields with empty strings, and filtering emptry string would yield no results. To address this issue, we need to pass queryEmptyString as false when using termQuery for these fields.

For example,

...termQuery(TRANSACTION_TYPE, ruleParams.transactionType, {
    queryEmptyString: false,
 }),

Fortunately, this issue has been fixed in v8.6, but there was a regression in my previous PR that caused the issue to resurface.

The tests we have in place were not sufficient to detect the regression. 😢

Next
I need to revert the change that removed the queryEmptyString parameter and ensure that empty strings are not filtered out

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but imo sending an empty string can lead to misleading results.

Agree, in most cases undefined is better than "" we just need to make sure that old rules with an empty string still works.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests we have in place were not sufficient to detect the regression. 😢

Can you fix that? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert the change

I'll start working on the tests

@kpatticha kpatticha force-pushed the 152329-alert-transaction-name-error-rate branch from fd6c89a to a41a8f3 Compare April 21, 2023 15:40
@kpatticha
Copy link
Contributor Author

@elasticmachine merge upstream

@kpatticha
Copy link
Contributor Author

@elasticmachine merge upstream

@kpatticha kpatticha enabled auto-merge (squash) April 24, 2023 13:12
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
apm 3.5MB 3.5MB +201.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
enterpriseSearch 17 19 +2
securitySolution 395 398 +3
total +5

Total ESLint disabled count

id before after diff
enterpriseSearch 18 20 +2
securitySolution 475 478 +3
total +5

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@kpatticha kpatticha merged commit 111d04f into elastic:main Apr 24, 2023
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Apr 24, 2023
nikitaindik pushed a commit to nikitaindik/kibana that referenced this pull request Apr 25, 2023
elastic#155405)

part of elastic#152329
related work elastic#154241

Introduces the Transaction name filter in the failed transaction rate
rule type
 



https://user-images.githubusercontent.com/3369346/233386404-1875b283-0321-4bf1-a7d3-66327f7d4ec5.mov


## Fixes

The regression introduces in a previous
[PR](elastic@fce4ef8)

Existing rule types can have empty string in their params so we need to
make sure we don't filter empty values as it will yield no results.

---------

Co-authored-by: kibanamachine <42973632+kibanamachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting release_note:enhancement Team:APM All issues that need APM UI Team support v8.8.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants