diff --git a/x-pack/plugins/observability_solution/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts b/x-pack/plugins/observability_solution/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts index 207f2fcb7cb2..e911440ce5aa 100644 --- a/x-pack/plugins/observability_solution/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts +++ b/x-pack/plugins/observability_solution/infra/server/lib/alerting/inventory_metric_threshold/lib/get_data.ts @@ -159,9 +159,9 @@ export const getData = async ( customMetric, fieldsExisted ); - logger.trace(`Request: ${JSON.stringify(request)}`); + logger.trace(() => `Request: ${JSON.stringify(request)}`); const body = await esClient.search(request); - logger.trace(`Response: ${JSON.stringify(body)}`); + logger.trace(() => `Response: ${JSON.stringify(body)}`); if (body.aggregations) { return handleResponse(body.aggregations, previousNodes); } diff --git a/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts b/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts index f5e2a19cb70e..d50c11710db7 100644 --- a/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts +++ b/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/check_missing_group.ts @@ -57,9 +57,9 @@ export const checkMissingGroups = async ( ]; }); - logger.trace(`Request: ${JSON.stringify({ searches })}`); + logger.trace(() => `Request: ${JSON.stringify({ searches })}`); const response = await esClient.msearch({ searches }); - logger.trace(`Response: ${JSON.stringify(response)}`); + logger.trace(() => `Response: ${JSON.stringify(response)}`); const verifiedMissingGroups = response.responses .map((resp, index) => { diff --git a/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/get_data.ts b/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/get_data.ts index d2afb40cecf5..e30edbeac936 100644 --- a/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/get_data.ts +++ b/x-pack/plugins/observability_solution/infra/server/lib/alerting/metric_threshold/lib/get_data.ts @@ -277,10 +277,10 @@ export const getData = async ( fieldsExisted ), }; - logger.trace(`Request: ${JSON.stringify(request)}`); + logger.trace(() => `Request: ${JSON.stringify(request)}`); const body = await esClient.search(request); const { aggregations, _shards } = body; - logger.trace(`Response: ${JSON.stringify(body)}`); + logger.trace(() => `Response: ${JSON.stringify(body)}`); if (aggregations) { return handleResponse(aggregations, previousResults, _shards.successful); } else if (_shards.successful) {