From 247283b9df1423771edab9f84e148453966b35b9 Mon Sep 17 00:00:00 2001 From: Joshua Li Date: Thu, 21 Dec 2023 23:14:45 +0000 Subject: [PATCH] fix config errors Signed-off-by: Joshua Li --- opensearch_dashboards.json | 4 ++-- package.json | 4 ++-- server/routes/query_assist/routes.ts | 15 ++++++++++++--- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/opensearch_dashboards.json b/opensearch_dashboards.json index 33bd7a7c5c..efaf215872 100644 --- a/opensearch_dashboards.json +++ b/opensearch_dashboards.json @@ -1,7 +1,7 @@ { "id": "observabilityDashboards", - "version": "2.11.0.0", - "opensearchDashboardsVersion": "2.11.0", + "version": "3.0.0.0", + "opensearchDashboardsVersion": "3.0.0", "server": true, "ui": true, "requiredPlugins": [ diff --git a/package.json b/package.json index cf6a4dd72d..3929fcd37d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "observability-dashboards", - "version": "2.11.0.0", + "version": "3.0.0.0", "main": "index.ts", "license": "Apache-2.0", "scripts": { @@ -82,4 +82,4 @@ "node_modules/*", "target/*" ] -} +} \ No newline at end of file diff --git a/server/routes/query_assist/routes.ts b/server/routes/query_assist/routes.ts index 9ae8c4203f..edf030742e 100644 --- a/server/routes/query_assist/routes.ts +++ b/server/routes/query_assist/routes.ts @@ -37,7 +37,7 @@ export function registerQueryAssistRoutes(router: IRouter, config: Observability ppl_agent_id: pplAgentId, response_summary_agent_id: responseSummaryAgentId, error_summary_agent_id: ErrorSummaryAgentId, - } = config.observability.query_assist; + } = config.query_assist; router.post( { @@ -54,7 +54,12 @@ export function registerQueryAssistRoutes(router: IRouter, config: Observability request, response ): Promise> => { - if (!pplAgentId) return response.custom({ statusCode: 400, body: 'PPL agent not found.' }); + if (!pplAgentId) + return response.custom({ + statusCode: 400, + body: + 'PPL agent not found in opensearch_dashboards.yml. Expected observability.query_assist.ppl_agent_id', + }); const client = context.core.opensearch.client.asCurrentUser; try { @@ -112,7 +117,11 @@ export function registerQueryAssistRoutes(router: IRouter, config: Observability response ): Promise> => { if (!responseSummaryAgentId || !ErrorSummaryAgentId) - return response.custom({ statusCode: 400, body: 'Summary agent not found.' }); + return response.custom({ + statusCode: 400, + body: + 'Summary agent not found in opensearch_dashboards.yml. Expected observability.query_assist.response_summary_agent_id and observability.query_assist.error_summary_agent_id', + }); const client = context.core.opensearch.client.asCurrentUser; const { index, question, query, response: _response, isError } = request.body;