-
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
Migrate kql telemetry and scripts api #52651
Conversation
Pinging @elastic/kibana-app (Team:KibanaApp) |
Pinging @elastic/kibana-app-arch (Team:AppArch) |
Jenkins, test this |
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.
Code LGTM; thank you for doing this! (Tested Chrome OSX and verified routes are still working)
@@ -20,6 +20,7 @@ | |||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should import from public
here if possible, instead of common
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is async
necessary here?
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.
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.
@@ -9,5 +9,5 @@ returns `basePath` value, specific for an incoming request. | |||
<b>Signature:</b> | |||
|
|||
```typescript | |||
get: (request: LegacyRequest | KibanaRequest<unknown, unknown, unknown, any>) => string; |
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.
@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
data
plugin as well