ankitsultana commented on code in PR #14048:
URL: https://github.com/apache/pinot/pull/14048#discussion_r1772517709
##########
pinot-broker/src/main/java/org/apache/pinot/broker/api/resources/PinotClientRequest.java:
##########
@@ -236,6 +238,48 @@ public void processSqlWithMultiStageQueryEnginePost(String
query, @Suspended Asy
}
}
+ @GET
+ @ManagedAsync
+ @Produces(MediaType.APPLICATION_JSON)
+ @Path("timeseries/api/v1/query_range")
+ @ApiOperation(value = "Prometheus Compatible API for Pinot's Time Series
Engine")
+ @ManualAuthorization
+ public void processTimeSeriesQueryEngine(@Suspended AsyncResponse
asyncResponse,
+ @QueryParam("language") String language,
+ @Context org.glassfish.grizzly.http.server.Request requestCtx,
+ @Context HttpHeaders httpHeaders) {
+ try {
+ try (RequestScope requestContext =
Tracing.getTracer().createRequestScope()) {
+ String queryString = requestCtx.getQueryString();
+ PinotBrokerTimeSeriesResponse response =
executeTimeSeriesQuery(language, queryString, requestContext);
+ if (response.getErrorType() != null &&
!response.getErrorType().isEmpty()) {
+
asyncResponse.resume(Response.serverError().entity(response).build());
+ return;
+ }
+ asyncResponse.resume(response);
+ }
+ } catch (Exception e) {
+ LOGGER.error("Caught exception while processing POST request", e);
Review Comment:
In the execution part we catch exception, and create a
"PinotBrokerTimeSeriesResponse" with the error and errorType set. Right now we
don't have good error categories but it's a good point, we should converge on a
standard. Added an item to the tracker
https://github.com/apache/pinot/issues/13957
--
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]