Observability & APM do not use elasticsearch client provided via setup contract (#67263)

* dump prettier version to v2

* use elasticserch client provided via context

* use es client provided from start contract
This commit is contained in:
Mikhail Shustov 2020-05-26 15:52:05 +03:00 committed by GitHub
parent c508140c95
commit cec99f9c49
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

@ -57,7 +57,8 @@ export async function createApmTelemetry({
const collectAndStore = async () => {
const config = await config$.pipe(take(1)).toPromise();
const esClient = core.elasticsearch.dataClient;
const [{ elasticsearch }] = await core.getStartServices();
const esClient = elasticsearch.legacy.client;
const indices = await getApmIndices({
config,

View file

@ -39,7 +39,7 @@ export async function bootstrapAnnotations({ index, core, context }: Params) {
getScopedAnnotationsClient: (requestContext: RequestHandlerContext, request: KibanaRequest) => {
return createAnnotationsClient({
index,
apiCaller: core.elasticsearch.dataClient.asScoped(request).callAsCurrentUser,
apiCaller: requestContext.core.elasticsearch.dataClient.callAsCurrentUser,
logger,
license: requestContext.licensing?.license,
});

View file

@ -50,7 +50,7 @@ export function registerAnnotationAPIs({
});
}
const apiCaller = core.elasticsearch.dataClient.asScoped(request).callAsCurrentUser;
const apiCaller = context.core.elasticsearch.dataClient.callAsCurrentUser;
const client = createAnnotationsClient({
index,