discourse-data-explorer/spec
Ted Johansson bc02d030b6
DEV: Add configurable rate limit for Data Explorer API query runs (#238)
Data Explorer can run arbitrary SQL queries which can be costly for us if over-used. Because of that we want to add the ability to rate limit the query run endpoint, in particular when requested programmatically using API.

This commit introduces a rate limit to the `QueryController#run` endpoint. It heavily leans on the existing `RateLimiter` implementation, and the ability of `ApplicationController` to turn rate limit exceptions into nicely formatted JSON responses.

The rate limit (per 10 seconds) can be configured through the global setting `max_data_explorer_api_reqs_per_10_seconds`, and defaults to 2.

Handling can be configured through `max_data_explorer_api_req_mode`, and can be set to warn, block, or both warn and block. We will default to warn for now and monitor the logs for a while.
2023-04-03 13:46:35 +08:00
..
automation FIX: Flaky test fix for Data Explorer Automated PM Feature (#235) 2023-03-27 15:57:33 +08:00
fabricators FEATURE: Allow data explorer query result to be sent as recurring PM (#233) 2023-03-24 16:38:42 +08:00
integration DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
jobs/scheduled DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
lib/data_explorer DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
requests DEV: Add configurable rate limit for Data Explorer API query runs (#238) 2023-04-03 13:46:35 +08:00
system FIX: clear state when reports are changed (#226) 2023-02-22 16:25:33 +11:00
tasks DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
data_explorer_spec.rb DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
guardian_spec.rb DEV: Update plugin to match latest guidelines (#229) 2023-03-22 23:29:08 +02:00
report_generator_spec.rb FEATURE: Allow data explorer query result to be sent as recurring PM (#233) 2023-03-24 16:38:42 +08:00