Commit Graph

67 Commits

Author SHA1 Message Date
Daniel García Aubert
762a240890 Breaking changes:
- Log system revamp:
  - Logs to stdout, disabled while testing
  - Use header `X-Request-Id`, or create a new `uuid` when no present, to identyfy log entries
  - Be able to set log level from env variable `LOG_LEVEL`, useful while testing: `LOG_LEVEL=info npm test`; even more human-readable: `LOG_LEVEL=info npm t | ./node_modules/.bin/pino-pretty`
  - Be able to reduce the footprint in the final log file depending on the environment
  - Use one logger for every service: Queries, Batch Queries (Jobs), and Data Ingestion (CopyTo/CopyFrom)
  - Stop using headers such as: `X-SQL-API-Log`, `X-SQL-API-Profiler`, and `X-SQL-API-Errors` as a way to log info.
  - Be able to tag requests with labels as an easier way to provide business metrics
  - Metro: Add log-collector utility (`metro`), it will be moved to its own repository. Attaching it here fro development purposes. Try it with the following command `LOG_LEVEL=info npm t | node metro`
  - Metro: Creates `metrics-collector.js` a stream to update Prometheus' counters and histograms and exposes them via Express' app (`:9145/metrics`). Use the ones defined in `grok_exporter`

Announcements:
- Profiler is always set. No need to check its existence anymore
- Unify profiler usage for every endpoint

Bug fixes:
- Avoid hung requests while fetching user identifier
2020-06-30 17:42:59 +02:00
Esther Lozano
419adea234
Add pubsub metrics (#642)
* Create middleware and service for pubsub metrics

* Use pubsub middleware for all request

* Replace isEnabled with isDisabled to avoid negation

* Use new headers names

* Add acceptance and unit tests

* Remove commented log calls

* Remove only filters in tests

Remove typo

* Refactor service to ease integration test

* Fix interaction with query controller

* Use middleware at api-router and test all controllers

* Rename user middleware function

* Use sinon latest version

* Create middleware and service for pubsub metrics

* Use pubsub middleware for all request

* Replace isEnabled with isDisabled to avoid negation

* Use new headers names

* Add acceptance and unit tests

* Remove commented log calls

* Remove only filters in tests

Remove typo

* Refactor service to ease integration test

* Fix interaction with query controller

* Use middleware at api-router and test all controllers

* Rename user middleware function

* Use sinon latest version

* Fix tests

* Fix typos

* Checks if pubsub config exists to enable the service

* Fix typo

* Normalize headers values for pubsub

* Trim fields when normalizing

* Trim fields when normalizing
2020-02-26 17:19:06 +01:00
Daniel García Aubert
cec1c609c0 Have a default configuration of "routes" when missing environment settings. It prevents errors while deploying (if the new setting is not available yet) 2019-10-02 17:35:34 +02:00
Daniel García Aubert
51ea2b066d Create sql-router to encapsulate common stuff from api-router. Extract WIP jobs from job-controller and attatch it to api-router.
Note: it modifies routes structure in configuration.
2019-10-02 16:02:13 +02:00
Daniel García Aubert
f71c7bc3a8 Typo 2019-10-01 17:54:09 +02:00
Daniel García Aubert
1d55de3e43 Explicit routes configuration 2019-10-01 17:45:12 +02:00
Daniel García Aubert
3dee09a5c5 Draft: be able to inject custom middlewares 2019-10-01 17:27:46 +02:00
Daniel García Aubert
46190008f5 Remove table cache 2019-07-24 17:44:04 +02:00
Daniel García Aubert
ccb0bbfb86 Set directive 'max-age' to 5 min when there are affacted tables where we can't know when were updated for the last time, e.g: non cartodified tables or foreing tables without cartodb support 2019-07-04 10:45:35 +02:00
Daniel García Aubert
4ddcc3b0e6 Set minimum input data speed default to 0 bytes 2019-05-29 11:21:22 +02:00
Daniel García Aubert
6676260b17 Implement a throttler stream to check input data speed 2019-05-28 19:24:29 +02:00
Daniel García Aubert
e643eaa4a1 Enable keepalive for conections to DB 2019-05-06 18:51:00 +02:00
Simon Martín
68aebe6b3f Merge branch 'master' into log-queries 2019-02-27 16:14:12 +01:00
Simon Martín
b35654d1f6 copy config parameters 2019-02-27 13:00:52 +01:00
Simon Martín
3723befc11 config parameters 2019-02-27 12:49:55 +01:00
Simon Martín
254896e666 remove query_format rate limit 2018-12-10 18:20:10 +01:00
Rafa de la Torre
a709e8f26f Set the default copy_from_max_post_size to 2 GB
Set the default copy_from_max_post_size to exactly 2 GB, as the nginx
limitation has been removed for that endpoint. So, the application is
now in control and this keeps the code clear and clean.
2018-07-26 12:52:20 +02:00
Rafa de la Torre
0a7edc2e11 Add missing COPY config parameters to staging.js.example
I forgot to add these to the staging example file and missed them when
testing config changes there.

Related to https://github.com/CartoDB/CartoDB-SQL-API/pull/523
2018-07-26 12:46:05 +02:00
Simon Martín
fca6ee8232 changing name of dataIngestionLogPath 2018-05-23 17:32:44 +02:00
Simon Martín
b2a36eb556 copy metrics with BunyanLogger 2018-05-23 17:25:46 +02:00
Simon Martín
b373c76d8c adding parameter in config files 2018-04-24 15:54:48 +02:00
Simon Martín
35df7798ab config params 2018-03-01 11:30:58 +01:00
Simon Martín
8665caa3cb changing error log format 2017-12-12 10:55:54 +01:00
Simon Martín
1eae2e4790 adding error header to environment files 2017-11-28 17:32:29 +01:00
Rafa de la Torre
8c2e5f74df Add tableCacheEnabled setting to sample config #422 2017-06-27 13:14:13 +02:00
Raul Ochoa
14846b254e Document gc_interval configuration param 2017-04-24 18:28:10 +02:00
Daniel García Aubert
4b98b7056a Make zip command path configurable 2017-04-18 12:15:47 +02:00
Raul Ochoa
aa69bcf34c Increase to 4 the default value for fixed capacity 2016-10-20 20:16:34 +02:00
Raul Ochoa
19def2f31e Default to 2 jobs in fixed capacity. 2016-10-20 11:12:27 +02:00
Raul Ochoa
66cc137d04 Split http capacity between simple and load
- Simple will use 'available_cores' from response.
- Load will use 'cores' and 'relative_load'.
2016-10-20 11:12:08 +02:00
Raul Ochoa
0af5cf703a Allow to configure capacity strategy
- HTTP strategy: mechanism to compute load from db host.
- Fixed strategy: hardcoded number of queries to run at the same time, via configuration.
2016-10-19 18:42:53 +02:00
Raul Ochoa
66d1c18941 Default to 64 queued jobs as max 2016-10-17 15:23:53 +02:00
Raul Ochoa
1e442b37ab Allow to set a max number of queued jobs per user 2016-10-12 22:40:35 +02:00
Raul Ochoa
595d4f0918 Fix sample config for batch timeout 2016-10-10 11:10:28 +02:00
Raul Ochoa
7c7320061f Merge branch 'master' into limit-batch-queries 2016-10-06 12:46:34 +02:00
Daniel García Aubert
59e5c10f85 Set batch queries log path 2016-09-29 15:37:14 +02:00
Raul Ochoa
0626d80e24 Removes support for optional rollbar logging 2016-09-14 19:22:31 +02:00
Daniel García Aubert
4f3d361226 Fixes #356, set limit to batch queries to 12h 2016-09-13 12:32:41 +02:00
Daniel García Aubert
2932227e8b Improved naming for jobs TTL constant 2016-08-30 13:49:16 +02:00
Daniel García Aubert
31ac48ef1a Changed job's ttl to be configurable 2016-01-21 15:33:42 +01:00
Daniel García Aubert
f41c43aa38 Disabled statement timeout bypassing pgbouncer connection 2015-12-22 15:43:00 +01:00
Raul Ochoa
93e965af29 Makes ogr2ogr command configurable so it's possible to change path/bin 2015-06-16 15:53:33 +02:00
Raul Ochoa
8fe4224a55 Changes configuration example base_url for subdomainless users 2015-04-08 16:14:05 +02:00
Luis Bosque
373dca0733 Added ; to the end of disabledfile config param 2015-03-25 18:28:45 +01:00
Luis Bosque
897df7634b Return failed health checks with disabled file 2015-03-25 17:15:41 +01:00
Raul Ochoa
9dcb397737 Merge pull request #205 from CartoDB/url_rewrite
added /u/:user routing
2015-03-20 12:22:07 +01:00
Raul Ochoa
a9dac76e38 Examples for configuring max size per row limit 2015-02-26 16:18:37 +01:00
Raul Ochoa
dc388ca2db Adds configuration options examples for keep alive 2015-02-19 17:27:41 +01:00
Raul Ochoa
e5ab4272eb Use a multiple params route to be able to extract the username from
the path or default to host header.
2015-02-02 12:09:34 +01:00
Raul Ochoa
7c62632ea8 Health check endpoint 2014-08-26 18:40:58 +02:00