erankor commented on issue #6017: Logging of invalid queries
URL: 
https://github.com/apache/incubator-druid/issues/6017#issuecomment-555438649
 
 
   @sbespalov, in the Druid version we are currently using (0.10.0), the sample 
bad query you pasted is not logged -
   ```
   $ curl -i -X POST -H "Content-Type:application/json" -d '{"query":"invalid 
query","resultFormat":"array","header":true}' 'http://localhost:8082/druid/v2/'
   HTTP/1.1 500 Internal Server Error
   Date: Tue, 19 Nov 2019 10:11:28 GMT
   Content-Type: application/json
   Content-Length: 357
   Server: Jetty(9.3.16.v20170120)
   
   {"error":"Unknown exception","errorMessage":"Unexpected token (END_OBJECT), 
expected FIELD_NAME: missing property 'queryType' that is to contain type id  
(for class io.druid.query.Query)\n at [Source: 
HttpInputOverHTTP@2b261ee9[c=62,q=1,[0]=EOF,s=STREAM]; line: 1, column: 
62]","errorClass":"com.fasterxml.jackson.databind.JsonMappingException","host":null}
   
   $ grep -i invalid 2019-11-19.log
   $ 
   ```
   So I guess there was progress on this since I opened this issue, which is 
great!
   
   I think that ideally all queries should be logged (=the raw query body, 
since it may not parse at all), but cases in which the query body is not a 
valid JSON are IMHO of lesser importance. I'm saying this because I assume most 
people are building the queries using some JSON library, which makes the 
probability of invalid JSON very low.
   Most errors are probably queries that are a valid JSON, but make no sense to 
Druid, for example, a topN query without `threshold`, or a topN query 
referencing a metric that is not listed in the aggregations etc.

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

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

Reply via email to