Skip to content

[Rules] Enable versatile EBT#221163

Merged
baileycash-elastic merged 21 commits intoelastic:mainfrom
baileycash-elastic:telemetry-219986-ebt
Jun 12, 2025
Merged

[Rules] Enable versatile EBT#221163
baileycash-elastic merged 21 commits intoelastic:mainfrom
baileycash-elastic:telemetry-219986-ebt

Conversation

@baileycash-elastic
Copy link
Contributor

@baileycash-elastic baileycash-elastic commented May 21, 2025

Summary

Partially implements #219986

  • Collect clicks / interactions with rules objects
  • Determine the source of the clicks (rule details page vs table)
  • How often users snooze, enable, disable, run rules
  • This PR specifically enables the ability to determine how often these actions occur by rule type

Query Examples

properties.target: "data-test-subj=snoozeButton"

Will give you documents that will tell you that a user clicked on the snooze button on any page

properties.target: "data-test-subj=snoozeButton" and "data-test-subj=collapsedActionPanel"

Will give you documents that will tell you that a user clicked on the snooze button on the collapsed action panel on the table INSTEAD OF the snooze button in the notify column or details page

properties.target: "data-test-subj=ruleType_slo.rules.burnRate" and properties.target: "data-test-subj=snoozeButton"

Will give you documents where SLO burn rate rules were snoozed

Local Testing

Add the following to kibana.dev.yml

telemetry:
  localShipper: true

Clicks will begin registering to the ebt-kibana-browser index with target arrays that include the new test subject values.

Sample target array with the changes:
example.txt

  • Click location (page name)
  • Rule type
  • Button label

@baileycash-elastic baileycash-elastic added release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. backport:version Backport to applied version labels v8.19.0 labels May 21, 2025
@github-actions github-actions bot added the author:obs-ux-management PRs authored by the obs ux management team label May 21, 2025
@baileycash-elastic baileycash-elastic changed the title begin enhancing rules ebt telemetry [Rules] Add rule type to data test subj line May 21, 2025
@baileycash-elastic baileycash-elastic marked this pull request as ready for review May 22, 2025 14:38
@baileycash-elastic baileycash-elastic requested review from a team as code owners May 22, 2025 14:38
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@baileycash-elastic baileycash-elastic changed the title [Rules] Add rule type to data test subj line [Rules] Add rule type to rule actions context menus May 22, 2025
@baileycash-elastic baileycash-elastic marked this pull request as draft May 22, 2025 18:19
@baileycash-elastic baileycash-elastic marked this pull request as ready for review June 3, 2025 21:32
unsnoozeRule={async (scheduleIds) => await onUnsnoozeRule(rule, scheduleIds)}
isRuleEditable={rule.isEditable}
/>
<div data-test-subj={`ruleType_${rule.ruleTypeId}`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

table cell for snooze

Copy link
Contributor

Choose a reason for hiding this comment

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

same here, if possible, remove the div and add the data-test-subj attribute to the RulesListNotifyBadge

Copy link
Contributor

@kdelemme kdelemme Jun 12, 2025

Choose a reason for hiding this comment

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

Can't we add data-test-subj={ruleType_${rule.ruleTypeId}} directly on the RulesListNotifyBadge?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't add it here because the notify badge is used by several components and also has several return statements. I would have to pass the ruleType as an optional prop then optionally add it to each of the possible return statements within the child component

Copy link
Contributor

Choose a reason for hiding this comment

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

we also checked to add it to the table cell itself but couldn't see anything that would allow us setting the test-subj prop

onRuleChanged={onRuleChanged}
isEditable={rule.isEditable && isRuleTypeEditableInContext(rule.ruleTypeId)}
/>
<div data-test-subj={`ruleType_${rule.ruleTypeId}`}>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

table cell for enable/disable

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not adding the data-test-subj attribute to the RuleStatusDropdown component? It's weird to change the layout because of tracking (that's what I'm understanding the reason is for adding this).

A general question, what if we change the data-test-subj value in the future? Wouldn't that break our tracking? Would it make sense to have another attribute like data-track-subj or similar?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I was told that attributes with the data-test-subj tag are what triggers the "automatic" telemetry data collection. If there's another, less-frequently touched attribute that achieves the same purpose, I'm open to switching over to it :)

@baileycash-elastic baileycash-elastic changed the title [Rules] Add rule type to rule actions context menus [Rules] Enable versatile EBT Jun 6, 2025
@baileycash-elastic baileycash-elastic requested a review from jcger June 11, 2025 18:58
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

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
observability 1.3MB 1.3MB +88.0B
triggersActionsUi 1.5MB 1.5MB +195.0B
total +283.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
alerting 92 96 +4

Total ESLint disabled count

id before after diff
alerting 99 103 +4

History

Copy link
Contributor

@kdelemme kdelemme left a comment

Choose a reason for hiding this comment

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

Just a suggestion otherwise LGTM

@baileycash-elastic baileycash-elastic merged commit d17f69c into elastic:main Jun 12, 2025
10 checks passed
@kibanamachine
Copy link
Contributor

Starting backport for target branches: 8.19

https://github.com/elastic/kibana/actions/runs/15613288673

kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Jun 12, 2025
## Summary
Partially implements elastic#219986

- Collect clicks / interactions with rules objects
- Determine the source of the clicks (rule details page vs table)
- How often users snooze, enable, disable, run rules
- This PR specifically enables the ability to determine how often these
actions occur by rule type

## Query Examples

```
properties.target: "data-test-subj=snoozeButton"
```
Will give you documents that will tell you that a user clicked on the
snooze button on any page

```
properties.target: "data-test-subj=snoozeButton" and "data-test-subj=collapsedActionPanel"
```
Will give you documents that will tell you that a user clicked on the
snooze button on the collapsed action panel on the table INSTEAD OF the
snooze button in the notify column or details page

```
properties.target: "data-test-subj=ruleType_slo.rules.burnRate" and properties.target: "data-test-subj=snoozeButton"
```
Will give you documents where SLO burn rate rules were snoozed

## Local Testing

Add the following to kibana.dev.yml

```
telemetry:
  localShipper: true
```

Clicks will begin registering to the `ebt-kibana-browser` index with
target arrays that include the new test subject values.

Sample target array with the changes:

[example.txt](https://github.com/user-attachments/files/20630704/example.txt)

- Click location (page name)
- Rule type
- Button label

(cherry picked from commit d17f69c)
@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.19

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Jun 12, 2025
# Backport

This will backport the following commits from `main` to `8.19`:
- [[Rules] Enable versatile EBT
(#221163)](#221163)

<!--- Backport version: 9.6.6 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Bailey
Cash","email":"bailey.cash@elastic.co"},"sourceCommit":{"committedDate":"2025-06-12T14:26:36Z","message":"[Rules]
Enable versatile EBT (#221163)\n\n## Summary\nPartially implements
#219986\n\n- Collect clicks / interactions with rules objects\n-
Determine the source of the clicks (rule details page vs table)\n- How
often users snooze, enable, disable, run rules\n- This PR specifically
enables the ability to determine how often these\nactions occur by rule
type\n\n## Query Examples\n\n```\nproperties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents that will
tell you that a user clicked on the\nsnooze button on any
page\n\n```\nproperties.target: \"data-test-subj=snoozeButton\" and
\"data-test-subj=collapsedActionPanel\"\n```\nWill give you documents
that will tell you that a user clicked on the\nsnooze button on the
collapsed action panel on the table INSTEAD OF the\nsnooze button in the
notify column or details page\n\n```\nproperties.target:
\"data-test-subj=ruleType_slo.rules.burnRate\" and properties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents where SLO
burn rate rules were snoozed\n\n## Local Testing\n\nAdd the following to
kibana.dev.yml\n\n```\ntelemetry:\n localShipper: true\n```\n\nClicks
will begin registering to the `ebt-kibana-browser` index with\ntarget
arrays that include the new test subject values.\n\nSample target array
with the
changes:\n\n[example.txt](https://github.com/user-attachments/files/20630704/example.txt)\n\n-
Click location (page name)\n- Rule type\n- Button
label","sha":"d17f69c863684d70469e73d0549ccdad94c83748","branchLabelMapping":{"^v9.1.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["release_note:skip","Team:ResponseOps","Team:obs-ux-management","backport:version","v9.1.0","v8.19.0","author:obs-ux-management"],"title":"[Rules]
Enable versatile
EBT","number":221163,"url":"https://github.com/elastic/kibana/pull/221163","mergeCommit":{"message":"[Rules]
Enable versatile EBT (#221163)\n\n## Summary\nPartially implements
#219986\n\n- Collect clicks / interactions with rules objects\n-
Determine the source of the clicks (rule details page vs table)\n- How
often users snooze, enable, disable, run rules\n- This PR specifically
enables the ability to determine how often these\nactions occur by rule
type\n\n## Query Examples\n\n```\nproperties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents that will
tell you that a user clicked on the\nsnooze button on any
page\n\n```\nproperties.target: \"data-test-subj=snoozeButton\" and
\"data-test-subj=collapsedActionPanel\"\n```\nWill give you documents
that will tell you that a user clicked on the\nsnooze button on the
collapsed action panel on the table INSTEAD OF the\nsnooze button in the
notify column or details page\n\n```\nproperties.target:
\"data-test-subj=ruleType_slo.rules.burnRate\" and properties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents where SLO
burn rate rules were snoozed\n\n## Local Testing\n\nAdd the following to
kibana.dev.yml\n\n```\ntelemetry:\n localShipper: true\n```\n\nClicks
will begin registering to the `ebt-kibana-browser` index with\ntarget
arrays that include the new test subject values.\n\nSample target array
with the
changes:\n\n[example.txt](https://github.com/user-attachments/files/20630704/example.txt)\n\n-
Click location (page name)\n- Rule type\n- Button
label","sha":"d17f69c863684d70469e73d0549ccdad94c83748"}},"sourceBranch":"main","suggestedTargetBranches":["8.19"],"targetPullRequestStates":[{"branch":"main","label":"v9.1.0","branchLabelMappingKey":"^v9.1.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/221163","number":221163,"mergeCommit":{"message":"[Rules]
Enable versatile EBT (#221163)\n\n## Summary\nPartially implements
#219986\n\n- Collect clicks / interactions with rules objects\n-
Determine the source of the clicks (rule details page vs table)\n- How
often users snooze, enable, disable, run rules\n- This PR specifically
enables the ability to determine how often these\nactions occur by rule
type\n\n## Query Examples\n\n```\nproperties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents that will
tell you that a user clicked on the\nsnooze button on any
page\n\n```\nproperties.target: \"data-test-subj=snoozeButton\" and
\"data-test-subj=collapsedActionPanel\"\n```\nWill give you documents
that will tell you that a user clicked on the\nsnooze button on the
collapsed action panel on the table INSTEAD OF the\nsnooze button in the
notify column or details page\n\n```\nproperties.target:
\"data-test-subj=ruleType_slo.rules.burnRate\" and properties.target:
\"data-test-subj=snoozeButton\"\n```\nWill give you documents where SLO
burn rate rules were snoozed\n\n## Local Testing\n\nAdd the following to
kibana.dev.yml\n\n```\ntelemetry:\n localShipper: true\n```\n\nClicks
will begin registering to the `ebt-kibana-browser` index with\ntarget
arrays that include the new test subject values.\n\nSample target array
with the
changes:\n\n[example.txt](https://github.com/user-attachments/files/20630704/example.txt)\n\n-
Click location (page name)\n- Rule type\n- Button
label","sha":"d17f69c863684d70469e73d0549ccdad94c83748"}},{"branch":"8.19","label":"v8.19.0","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Bailey Cash <bailey.cash@elastic.co>
iblancof pushed a commit to iblancof/kibana that referenced this pull request Jun 16, 2025
## Summary
Partially implements elastic#219986

- Collect clicks / interactions with rules objects
- Determine the source of the clicks (rule details page vs table)
- How often users snooze, enable, disable, run rules
- This PR specifically enables the ability to determine how often these
actions occur by rule type

## Query Examples

```
properties.target: "data-test-subj=snoozeButton"
```
Will give you documents that will tell you that a user clicked on the
snooze button on any page

```
properties.target: "data-test-subj=snoozeButton" and "data-test-subj=collapsedActionPanel"
```
Will give you documents that will tell you that a user clicked on the
snooze button on the collapsed action panel on the table INSTEAD OF the
snooze button in the notify column or details page

```
properties.target: "data-test-subj=ruleType_slo.rules.burnRate" and properties.target: "data-test-subj=snoozeButton"
```
Will give you documents where SLO burn rate rules were snoozed

## Local Testing

Add the following to kibana.dev.yml

```
telemetry:
  localShipper: true
```

Clicks will begin registering to the `ebt-kibana-browser` index with
target arrays that include the new test subject values.

Sample target array with the changes:

[example.txt](https://github.com/user-attachments/files/20630704/example.txt)

- Click location (page name)
- Rule type
- Button label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:obs-ux-management PRs authored by the obs ux management team backport:version Backport to applied version labels release_note:skip Skip the PR/issue when compiling release notes Team:actionable-obs Formerly "obs-ux-management", responsible for SLO, o11y alerting, significant events, & synthetics. Team:ResponseOps Platform ResponseOps team (formerly the Cases and Alerting teams) t// v8.19.0 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants