diff --git a/server/adaptors/metrics/metrics_analytics_adaptor.ts b/server/adaptors/metrics/metrics_analytics_adaptor.ts index 10f111d937..0e11abc466 100644 --- a/server/adaptors/metrics/metrics_analytics_adaptor.ts +++ b/server/adaptors/metrics/metrics_analytics_adaptor.ts @@ -14,11 +14,12 @@ export class MetricsAnalyticsAdaptor { body: query, index, }); + } else { + response = await client.callAsCurrentUser('search', { + body: query, + index, + }); } - response = await client.callAsCurrentUser('search', { - body: query, - index, - }); return response; } catch (error) { throw new Error('Fetch Otel Metrics Error:' + error);