-
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
[Maps] Add UI counters for triggers that open a new map #136991
Conversation
'visualize_geo_field', | ||
context.originatingApp ? context.originatingApp : 'unknownOriginatingApp' | ||
METRIC_TYPE.CLICK, | ||
`create_maps_vis_${context.originatingApp ? context.originatingApp : 'unknownOriginatingApp'}` |
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.
Note, the previous implementation of this UI counter (since 8.2) used a custom string ('visualize_geo_field'
) for counterType
rather than one of the preferred METRIC_TYPE
constants. While this is allowed, I think it makes more sense to use METRIC_TYPE.CLICK
and have a more descriptive eventName
.
Example of previous telemetry
{ appName: 'maps', counterType: 'visualize_geo_field', eventName: 'lens', total: 3 }
Example of new telemetry
{ appName: 'maps', counterType: 'click', eventName: 'create_map_vis_lens', total: 3 }
@@ -53,6 +54,7 @@ export function triggerVisualizeActions( | |||
indexPatternId, | |||
fieldName: field.name, | |||
contextualFields, | |||
originatingApp: PLUGIN_ID, |
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.
Hopefully this is OK (😅). We use the same context with triggers from Lens and Data Visualizer plugins.
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.
We may need to dig more into this change.
The PR that added UI counters to instrument when a geo field is visualized with visualizeGeoFieldAction added originatingApp
.
Replace "Save and return" button with "Save" for Lens visualization created from Discover histogram or visualised field to avoid confusion removed originatingApp
.
Now we are adding originatingApp
. Is adding originatingApp
going to reintroduce #128695?
@DianaDerevyankina can you provide some context on how originatingApp
was causing #128695?
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.
since @DianaDerevyankina is not longer working for EPAM/Elastic forwarding the question to @elastic/kibana-vis-editors
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.
Good catch @nreese , yes I think it would re-introduce this problem. The best idea I have to fix this is to ignore the originatingApp
for "Visualize field" navigations (if historyLocationState.type === ACTION_VISUALIZE_LENS_FIELD
holds true):
(historyLocationState.type === ACTION_VISUALIZE_LENS_FIELD || |
Feel free to add that logic in there - basically "if type is ACTION_VISUALIZE_LENS_FIELD, remove originatingApp
from initial context"
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 can't think of a good use case where an app would want to receive the created Lens visualization when coming via "visualize field"
Pinging @elastic/kibana-gis (Team:Geo) |
@elasticmachine merge upstream |
@elasticmachine merge upstream |
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.
Lens changes LGTM, thanks for the fix!
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.
LGTM
code review
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.
LGTM, tested Discover -> Lens and works as expected 👍
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
Summary
Updates the UI counters for triggers that open a new map from the Map listing page and from other apps.
There are multiple points where users can open a new map. We will increment the appropriate UI counter (
eventName
) whenever a user triggers a new map to open using the elements indicated in the screenshots below.Maps
eventName
:create_map_vis_editor
Data Visualizer
eventName
:create_map_vis_data_visualizer
Lens
eventName
:create_map_vis_lens
Discover
eventName
:create_map_vis_discover
Dashboard
The Dashboard plugin already collects events in their own namespace when a user creates a new Map from a dashboard. It does not seem necessary to collect a duplicate event in the Maps namespace.
eventName
:maps:create