abhishekrb19 commented on code in PR #19069:
URL: https://github.com/apache/druid/pull/19069#discussion_r2885249523


##########
web-console/src/utils/druid-query.ts:
##########
@@ -322,13 +322,31 @@ export class DruidError extends Error {
   }
 }
 
+// Broker service to use for all console queries (for tier isolation)
+let consoleBrokerService: string | undefined;
+
+export function setConsoleBrokerService(brokerService: string | undefined): 
void {
+  consoleBrokerService = brokerService;
+}
+
 export async function queryDruidRune(
   runeQuery: Record<string, any>,
   signal?: AbortSignal,
 ): Promise<any> {
   let runeResultResp: AxiosResponse;
   try {
-    runeResultResp = await Api.instance.post('/druid/v2', runeQuery, { signal 
});
+    // Inject brokerService into context if configured
+    const query = consoleBrokerService
+      ? {
+          ...runeQuery,
+          context: {
+            ...runeQuery.context,
+            brokerService: consoleBrokerService,
+          },
+        }
+      : runeQuery;
+
+    runeResultResp = await Api.instance.post('/druid/v2', query, { signal });

Review Comment:
   This endpoint would be used by native queries/specs submitted by the sampler 
flow. Should we remove this?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to