Skip to content

Commit

Permalink
Observability & APM do not use elasticsearch client provided via setu…
Browse files Browse the repository at this point in the history
…p contract (#67263) (#67322)

* dump prettier version to v2

* use elasticserch client provided via context

* use es client provided from start contract
  • Loading branch information
mshustov authored May 26, 2020
1 parent ce0e4f6 commit 622c014
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 622c014

Please sign in to comment.