Migrate kql telemetry and scripts api#52651
Conversation
|
Pinging @elastic/kibana-app (Team:KibanaApp) |
|
Pinging @elastic/kibana-app-arch (Team:AppArch) |
|
Jenkins, test this |
| import moment from 'moment-timezone'; | ||
| import numeralLanguages from '@elastic/numeral/languages'; | ||
| import { i18n } from '@kbn/i18n'; | ||
| import { DEFAULT_QUERY_LANGUAGE } from '../../../plugins/data/common'; |
There was a problem hiding this comment.
We should import from public here if possible, instead of common
There was a problem hiding this comment.
This file is used on the server, so importing from public won't work. Funny enough as it's not in a server dir, importing from server also doesn't work with the current linting rules. I would like to keep common for now and we can clean it up when migrating this file
src/plugins/data/server/plugin.ts
Outdated
| } | ||
|
|
||
| public setup(core: CoreSetup) { | ||
| public async setup(core: CoreSetup, { usageCollection }: DataPluginSetupDependencies) { |
There was a problem hiding this comment.
Is async necessary here?
There was a problem hiding this comment.
It's not, I used to block on telemetry service setup during development, but it doesn't make sense in practice. I made the async-ness an implementation detail.
| <b>Signature:</b> | ||
|
|
||
| ```typescript | ||
| get: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string; |
There was a problem hiding this comment.
@joshdover These are the strange core API changes this PR introduces.
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
This PR migrates the apis for kql telemetry (opting in/out) and the scripts api returning currently active scripting languages for scripted fields to the new platform.
As they are related to the services the data plugin already owns, these services are put into the
dataplugin as well