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

[Step 3] VisEditors Telemetry enhancements (add new agg-based and lens telemetries) #135615

Merged
merged 61 commits into from
Jul 25, 2022

Conversation

alexwizp
Copy link
Contributor

@alexwizp alexwizp commented Jul 1, 2022

Part of #132396

Category Event name
Render lens in different places render_lens_vis_editor
  render_lens_vis_dashboard_edit
  render_lens_vis_dashboard_view
  render_lens_vis_canvas
  NO: render_lens_vis_canvas_fullscreen
  render_lens_vis_observability_exploratory_view
  NO: ender_lens_vis_security_exploratory_view
  render_lens_vis_cases
Render lens vis type render_lens_area
  render_lens_area_stacked
  render_lens_area_percentage_stacked
  render_lens_vertical_bar
  render_lens_vertical_bar_stacked
  render_lens_vertical_bar_percentage_stacked
  render_lens_mixed_xy (Lens doesn't support that) render_agg_based_mixed_xy
  render_lens_horizontal_bar
  render_lens_horizontal_bar_stacked
  render_lens_horizontal_bar_percentage_stacked
  render_lens_horizontal_gauge
  render_lens_line
  render_lens_table
  render_lens_metric
  render_lens_mosaic
  render_lens_pie
  render_lens_vertical_gauge
  render_lens_donut
  render_lens_heatmap
  render_lens_treemap
  render_lens_waffle
  render_lens_map
Render lens layer render_lens_reference_layer
  render_lens_annotation_layer
  render_lens_multiple_data_layers
Render lens operation render_lens_dimension_average
  render_lens_dimension_count
  render_lens_dimension_unique_count
  render_lens_dimension_differences
  render_lens_dimension_last_value
  render_lens_dimension_max
  render_lens_dimension_median
  render_lens_dimension_min
  render_lens_dimension_percentile
  render_lens_dimension_sum
  render_lens_dimension_counter_rate
  render_lens_dimension_formula
  render_lens_dimension_cumulative_sum
  render_lens_dimension_moving_average
  render_lens_dimension_time_shift
  render_lens_dimension_color_by_value
  render_lens_dimension_summary_row
  render_lens_dimension_range
  render_lens_dimension_date_histogram
  render_lens_dimension_top_values
  render_lens_dimension_filters
Render agg based vis type render_agg_based_area
  render_agg_based_table
  render_agg_based_gauge
  render_agg_based_goal
  render_agg_based_heatmap
  render_agg_based_horizontal_bar
  render_agg_based_line
  render_agg_based_metric
  render_agg_based_pie
  render_agg_based_donut
  render_agg_based_tagcloud
  render_agg_based_timelion
  render_agg_based_vertical_bar
Render other vis vis type render_vega
  render_tsvb_timeseries
  render_tsvb_gauge
  render_tsvb_metric
  render_tsvb_top_n
  render_tsvb_markdown
  render_tsvb_table
  render_convertable_tsvb
Drag and drop events lens_drop_total
  lens_drop_onto_workspace
Lens embeddable errors lens_embeddable_runtime_error
  lens_embeddable_validation_error
Legacy/deprecation cases render_agg_based_table_split
  render_tsvb_last_value
  render_tsvb_index_pattern_string
Vega cases render_vega_lite
  render_vega_normal
  render_vega_map

@alexwizp alexwizp changed the title VisEditors Telemetry enhancements [WIP] VisEditors Telemetry enhancements Jul 1, 2022
@alexwizp alexwizp force-pushed the telemetry_1 branch 2 times, most recently from de5557a to a442730 Compare July 4, 2022 09:56
@alexwizp alexwizp changed the title [WIP] VisEditors Telemetry enhancements [Step 2] VisEditors Telemetry enhancements (add new agg-based telemetries) Jul 4, 2022
@alexwizp alexwizp force-pushed the telemetry_1 branch 3 times, most recently from fe2609a to c299d4f Compare July 4, 2022 13:53
@@ -442,7 +442,7 @@ export class VisualizeEmbeddable
private async updateHandler() {
const parentContext = this.parent?.getInput().executionContext || getExecutionContext().get();
const child: KibanaExecutionContext = {
type: 'visualization',
type: 'agg_based',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For people who will review: Please pay attention to this.

@@ -34,7 +34,7 @@ export const getGoalVisTypeDefinition = (
addTooltip: true,
addLegend: false,
isDisplayWarning: false,
type: 'gauge',
type: 'goal',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For people who will review: Please pay attention to this.

renderComplete={handlers.done}
renderComplete={() => {
// Renaming according to business requirements
const visTypeTelemetryMap: Record<string, string> = {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For people who will review: Please pay attention to this.

@alexwizp
Copy link
Contributor Author

alexwizp commented Jul 4, 2022

@elasticmachine merge upstream

@elastic elastic deleted a comment from kibana-ci Jul 4, 2022
@alexwizp alexwizp changed the title [Step 2] VisEditors Telemetry enhancements (add new agg-based telemetries) [Step 3] VisEditors Telemetry enhancements (add new agg-based and lens telemetries) Jul 5, 2022
@alexwizp alexwizp force-pushed the telemetry_1 branch 3 times, most recently from 28ee150 to 814923d Compare July 6, 2022 13:35
Copy link
Contributor

@nreese nreese left a comment

Choose a reason for hiding this comment

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

kibana-gis changes LGTM after changes map to regionmap.

Comment on lines +42 to +54
const renderComplete = () => {
const executionContext = handlers.getExecutionContext();
const containerType = extractContainerType(executionContext);
const visualizationType = extractVisualizationType(executionContext);

if (containerType && visualizationType) {
plugins.usageCollection?.reportUiCounter(containerType, METRIC_TYPE.COUNT, [
`render_${visualizationType}_metric`,
]);
}

handlers.done();
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Great.

@alexwizp alexwizp requested a review from pgayvallet July 21, 2022 08:57
@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

Response Ops changes LGTM! Code review only.

Copy link
Contributor

@pgayvallet pgayvallet left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the tests addition

alexwizp and others added 2 commits July 21, 2022 16:41
Copy link
Contributor

@dokmic dokmic left a comment

Choose a reason for hiding this comment

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

Expressions plugin changes LGTM 👍

@flash1293
Copy link
Contributor

flash1293 commented Jul 21, 2022

  • @alexwizp As Teresa mentioned it's OK to leave it out for now and as it doesn't work quite right anyway, let's remove

render_lens_vis_dashboard_edit vs render_lens_vis_dashboard_view and just do render_lens_vis_dashboard

@flash1293
Copy link
Contributor

flash1293 commented Jul 21, 2022

  • I just noticed that the lens operations are not tracked right - the description says A dimension which uses <name of function> function is rendered in a Lens chart outside of the editor in an embeddable(one increment per dimension) but it seems like it's only incrementing once per chart that's using a certain operation somewhere. Could we change this to count e.g. render_lens_dimension_count twice if there are two count dimensions in a single chart?

@flash1293
Copy link
Contributor

flash1293 commented Jul 21, 2022

  • render_tsvb_markdown and render_tsvb_timeseries is emitted twice when a TSVB markdown/timeseries panel is rendered on a dashboard (doesn't happen for other types)

@flash1293
Copy link
Contributor

flash1293 commented Jul 21, 2022

  • Agg based horizontal bar emits both a render_agg_based_horizontal_bar as well as a render_agg_based_mixed_xy

@flash1293
Copy link
Contributor

I can't reproduce the multi-counter anymore, maybe it got fixed by an unrelated change.

However, I noticed another problem - all charts rendering the default "no results found" view (e.g. tsvb table or agg based pie, but not TSVB timeseries) are not emitting a counter event at all

@flash1293
Copy link
Contributor

Seems like the comment from above about horizontal bar chart wasn't addressed, I can still see this behavior:
Screenshot 2022-07-25 at 09 25 39

@alexwizp
Copy link
Contributor Author

@elasticmachine merge upstream

Copy link
Contributor

@flash1293 flash1293 left a comment

Choose a reason for hiding this comment

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

Tested and didn't find any further issues, LGTM. Can't wait to tap that data!

# Conflicts:
#	x-pack/plugins/lens/public/drag_drop/drag_drop.tsx
#	x-pack/plugins/lens/public/editor_frame_service/editor_frame/editor_frame.tsx
#	x-pack/plugins/lens/public/editor_frame_service/editor_frame/workspace_panel/workspace_panel.tsx
#	x-pack/plugins/lens/public/lens_ui_telemetry/index.ts
#	x-pack/plugins/lens/public/plugin.ts
@kibana-ci
Copy link
Collaborator

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #23 / machine learning - data visualizer data view management "before each" hook for "adds new field"

Metrics [docs]

Module Count

Fewer modules leads to a faster build time

id before after diff
expressionGauge 37 38 +1
expressionHeatmap 66 68 +2
expressionLegacyMetricVis 30 32 +2
expressionMetricVis 20 22 +2
expressionPartitionVis 54 56 +2
expressionTagcloud 19 21 +2
expressionXY 110 113 +3
lens 932 934 +2
total +16

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
expressions 1726 1729 +3
lens 523 525 +2
total +5

Async chunks

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

id before after diff
canvas 1.0MB 1.0MB +60.0B
cases 355.5KB 355.5KB +32.0B
dashboard 409.1KB 409.1KB +17.0B
expressionGauge 10.8KB 10.8KB +21.0B
lens 1.2MB 1.2MB +3.1KB
observability 503.3KB 503.4KB +125.0B
visTypeTable 15.7KB 15.7KB +12.0B
visTypeTimeseries 451.0KB 451.0KB +2.0B
visTypeVega 1.7MB 1.7MB +1.0B
visTypeVislib 348.5KB 348.8KB +265.0B
visualizations 237.0KB 237.1KB +95.0B
total +3.7KB

Canvas Sharable Runtime

The Canvas "shareable runtime" is an bundle produced to enable running Canvas workpads outside of Kibana. This bundle is included in third-party webpages that embed canvas and therefor should be as slim as possible.

id before after diff
total size 7.7MB 7.7MB +27.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
expressionGauge 14.4KB 15.1KB +724.0B
expressionHeatmap 14.5KB 15.0KB +521.0B
expressionLegacyMetricVis 9.0KB 9.6KB +595.0B
expressionMetricVis 8.4KB 8.9KB +591.0B
expressionPartitionVis 23.0KB 23.5KB +512.0B
expressions 97.2KB 97.3KB +96.0B
expressionTagcloud 8.3KB 8.8KB +553.0B
expressionXY 32.9KB 34.0KB +1.1KB
lens 33.9KB 34.0KB +95.0B
maps 80.7KB 81.1KB +391.0B
visTypeGauge 9.7KB 9.7KB -1.0B
visTypeTable 15.1KB 15.5KB +495.0B
visTypeTimelion 10.0KB 10.5KB +493.0B
visTypeTimeseries 17.5KB 18.3KB +765.0B
visTypeVega 33.1KB 33.6KB +569.0B
visTypeVislib 15.5KB 15.7KB +217.0B
visTypeXy 43.1KB 43.7KB +613.0B
visualizations 46.8KB 46.8KB +23.0B
total +8.2KB
Unknown metric groups

API count

id before after diff
expressions 2180 2183 +3
lens 601 604 +3
total +6

History

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

cc @alexwizp

@alexwizp alexwizp merged commit d4bb959 into elastic:main Jul 25, 2022
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 Feature:ExpressionLanguage Interpreter expression language (aka canvas pipeline) Feature:TSVB TSVB (Time Series Visual Builder) Feature:Vega Vega visualizations Feature:Visualizations Generic visualization features (in case no more specific feature label is available) release_note:skip Skip the PR/issue when compiling release notes Team:Uptime - DEPRECATED Synthetics & RUM sub-team of Application Observability Team:Visualizations Visualization editors, elastic-charts and infrastructure v8.4.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.