-
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
[EBT] Track "click" events #131755
[EBT] Track "click" events #131755
Conversation
expect(targets.includes('DIV')).to.be(true); | ||
expect(targets.includes('id=kibana-body')).to.be(true); | ||
expect(targets.includes('data-test-subj=kibanaChrome')).to.be(true); |
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.
Is there an API in @kbn/expect
that allows you to match a subset of an array?
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 don't think so 😞
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.
Technically, LGTM.
I still have a concern about volume though. Recording all clicks will generate a massive amount of events. We need to make sure that our shipper backends are properly scaled in term of both influx and storage capacity. I'm especially thinking about the internal v3 telemetry endpoint/cluster.
expect(targets.includes('DIV')).to.be(true); | ||
expect(targets.includes('id=kibana-body')).to.be(true); | ||
expect(targets.includes('data-test-subj=kibanaChrome')).to.be(true); |
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 don't think so 😞
return [ | ||
...(target.parentElement ? getTargetDefinition(target.parentElement) : []), | ||
target.tagName, | ||
...[...target.attributes] | ||
.filter((attr) => !POTENTIAL_PII_HTML_ATTRIBUTES.includes(attr.name)) | ||
.map((attr) => `${attr.name}=${attr.value}`), | ||
]; |
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 don't necessarily have a better idea, but I still wonder how usable this will be, in practice.
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.
The idea I had in mind is that folks can identify if an action is performed by checking if a user clicked on a specific component. If knowing that the user interacted with that component is enough to identify that a feature is used, they don't need to instrument their own events.
In the past we've seen folks leveraging FullStory's click capture for this same purpose: How many users clicked on data-test-subj="my-special-button"
?.
Do you think we should take a different approach?
analytics.registerEventType<{ target: string[] }>({ | ||
eventType: 'click', | ||
schema: { |
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 thought FullStory already had its own internal collection of click events? If that's the case, maybe we should limit the event to the teleV3 shipper?
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.
#131146 already limits the events that are sent to FullStory.
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]Module Count
Page load bundle
Unknown metric groupsESLint disabled line counts
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
@pgayvallet, it is a very valid concern. According to our Application Usage telemetry, all our opted-in users add up to 4.5 million clicks daily. Bearing in mind that each click event is, approximately, 1.3kB (it largely depends on the length of the @elastic/platform-analytics, is this a volume we can assume? |
FWIW, I checked the current Security Solutions' inflow and they are sending 6x that volume. I think we should be fine. |
As confirmed with @haywoood on Slack, the volume should not be a problem. I'll go ahead and merge. |
Summary
This PR implements the
click
event for EBT.It listens to any
click
that occurs in the UI and reports it with the full list of attributes. For example, an HTML like:Will report an event like:
The target is reported as an array of strings because it feels easier to identify each value when analyzing them. Also, if we need a concatenated version, it's easier to concatenate in the analytics solution than to split by blank space because HTML allows you to store spaces in the attributes' values.
Resolves #125695.
Checklist
Risk Matrix
Delete this section if it is not applicable to this PR.
Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.
When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:
POTENTIAL_PII_HTML_ATTRIBUTES
constantFor maintainers