-
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
[Data table] Add telemetry for table vis split mode #88604
[Data table] Add telemetry for table vis split mode #88604
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
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 think the collector's implementation can use the SOs APIs instead of searching .kibana
ES
}, | ||
}, | ||
}; | ||
const { body: esResponse } = await esClient.search<ESResponse>(searchParams); |
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.
NIT: Shouldn't we use the soClient
(also provided in the fetch
context instead of searching to the .kibana
index? AFAIK, ES is planning to forbid direct access to the system indices in the future, and I don't think we are doing anything that the SO.find API doesn't support (i.e.: other plugins run aggregations).
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.
hey @afharo , thanks for the hint!! 🙏
Updated with the soClient
, code looks much more better now!
@@ -11,4 +11,5 @@ module.exports = { | |||
rootDir: '../../..', | |||
roots: ['<rootDir>/src/plugins/vis_type_table'], | |||
testRunner: 'jasmine2', | |||
collectCoverageFrom: ['<rootDir>/src/plugins/vis_type_table/**/*.{js,ts,tsx}'], |
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.
Are you sure we want to commit that? My objection is that if all plugins enable coverage generation, this will increase the already long CI execution time. If you feel that we really need it, probably it make sense to do it in a separate PR
also if I'm not wrong with collectCoverateFrom
we should also user collectCoverage
: true/false
param
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.
This string doesn't affect the CI somehow, since the CI doesn't use --coverage
flag.
This setting is only handy for local testing. So you can open a terminal right in the plugin folder and run yarn test:jest --coverage
, test coverage will be collected just for the vis_type_table
plugin.
If you skip the setting, the global one will be used (packages/kbn-test/jest-preset.js
), which will collect all of the files, including the plugin's one.
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! Thanks for the changes!
@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.
LGTM! Thank you
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.
Core review only, LGTM!
💚 Build SucceededMetrics [docs]Module Count
Async chunks
Page load bundle
History
To update your PR or re-run it, just comment with: |
* Add telemetry for table vis * Update telemetry schema * Add unit tests * Update license * Use soClient instead of esClient, update tests Co-authored-by: Kibana Machine <[email protected]>
* Add telemetry for table vis * Update telemetry schema * Add unit tests * Update license * Use soClient instead of esClient, update tests Co-authored-by: Kibana Machine <[email protected]> Co-authored-by: Kibana Machine <[email protected]>
Summary
Resolves #84924
This adds telemetry for data table visualization server side.
Metrics includes next count:
total
- Total number of table type visualizationstotal_split
- Total number of table visualizations, using "Split table" aggsplit_columns
- Split table by columns stats, includingtotal
and onlyenabled
count (since the agg could be disabled in the editor);split_rows
- Split table by rows stats, includingtotal
and onlyenabled
count (since the agg could be disabled in the editor);Here is the example of final shape of telemetry metrics:
How to test this:
Use kibana
/api/stats?extended=true&legacy=true
endpoint to run the usage collector. In the response, find the registeredvis_type_table
collector.Unit tests added:
Visualizations plugin changes
SavedVisState
&VisParams
interfaces were moved intocommon
folder from thepublic
one, since they are used in server parts ofvis_type_table
plugin.VisualizationSavedObjectAttributes
interface were created to type a visualization saved object.Checklist
Delete any items that are not applicable to this PR.
For maintainers