Commit Graph

6457 Commits

Author SHA1 Message Date
Daniel García Aubert
62d66f2dbc Do not use global logger in middlewares, use the one initialized in res.locals instead 2020-06-02 09:00:45 +02:00
Daniel García Aubert
e644201756 Merge branch 'master' into dgaubert/ch78384/maps-api-replace-log4js-logger-by-pino 2020-06-01 19:23:21 +02:00
Daniel G. Aubert
481a5928c4
Merge pull request #1169 from CartoDB/update-deps
Update deps
2020-06-01 19:21:34 +02:00
Daniel García Aubert
163c546236 Replace log4js by pino as logger:
- Logs to stdout, disabled while testing
- Change log calls signature when needed
- Use development version of camshaft
- Removes unused log cofiguration
- Bind request id to log req/res
- Log req at the begining of the cycle and res at the end
2020-06-01 19:18:15 +02:00
Daniel García Aubert
656bc9344b Update deps 2020-06-01 13:50:09 +02:00
Daniel García Aubert
b79a8587fa Update deps to fix some security vuln 2020-06-01 12:35:31 +02:00
Daniel G. Aubert
17337974a2
Merge pull request #1168 from CartoDB/dgaubert/ch77050/data-in-headers
Avoid custom headers to be undefined
2020-05-29 16:16:19 +02:00
Daniel García Aubert
6bcf477532 Avoid custom headers to be undefined 2020-05-29 16:06:16 +02:00
Daniel G. Aubert
bf7e8a6ec6
Merge pull request #1167 from CartoDB/dgaubert/ch77050/data-in-headers
Add 'Carto-Stat-Tag', 'Carto-User-Id', and 'Carto-Client' headers
2020-05-26 17:14:32 +02:00
Daniel García Aubert
f31e8b43b6 Duplicate 2020-05-26 17:03:53 +02:00
Daniel García Aubert
0090811510 Typo 2020-05-26 16:56:50 +02:00
Daniel García Aubert
b97aeda53c Adapt test-client to handle client query param 2020-05-26 16:52:13 +02:00
Daniel García Aubert
f82232194c Under if 2020-05-26 16:31:53 +02:00
Daniel García Aubert
aff5c9a614 Add test to check the headers exist while instantiating a map 2020-05-26 16:28:44 +02:00
Daniel García Aubert
ddefb1a6ca Add 'Carto-Stat-Tag', 'Carto-User-Id', and 'Carto-Client' headers 2020-05-26 13:15:35 +02:00
Daniel G. Aubert
4d06fee1e2
Merge pull request #1164 from CartoDB/node-12
Support Node.js 12
2020-05-20 15:57:46 +02:00
Daniel García Aubert
8febd81ed2 Merge branch 'master' into node-12 2020-05-20 09:15:05 +02:00
Daniel García Aubert
e575f01bef Upgrade gc-stats to version 1.4.0 2020-05-14 19:32:47 +02:00
Raúl Marín
f25f507945
Merge pull request #1165 from Algunenano/clang9
Force our packages to be used
2020-05-14 18:11:15 +02:00
Raúl Marín
bdbb529ea8 Force clang-9 to be used 2020-05-14 17:52:06 +02:00
Daniel García Aubert
0aac942aa1 Make query idempotent among PG versions 2020-05-14 13:13:32 +02:00
Daniel García Aubert
8cc24bc665 - Drop support for Node.js < 12
- Support Node.js 12
- Upgrade `windshaft` to version `7.0.0`
- Upgrade `camshaft` to version `0.65.3`
- Upgrade `cartodb-redis` to version `3.0.0`
2020-05-14 13:00:23 +02:00
Daniel G. Aubert
478ea66678
Merge pull request #1162 from CartoDB/dgaubert/ch71093/update-maps-api-to-new-event-format
New event format for metrics
2020-05-01 13:34:57 +02:00
Daniel García Aubert
4dfc898587 Don't log when metrics where sent successfully 2020-05-01 13:25:03 +02:00
Daniel García Aubert
05e77b2aed Add test with mapconfig's query against a table to ensure cache buster metrics are sent with the right values. 2020-05-01 11:43:37 +02:00
Daniel García Aubert
24863b6393 Update NEWS 2020-05-01 10:51:33 +02:00
Daniel García Aubert
3cf17c8bab typo 2020-05-01 10:40:56 +02:00
Daniel García Aubert
8c38ecf808 Missing substring 2020-04-30 13:24:41 +02:00
Daniel García Aubert
a196a26ab4 Get templateHash for static tile request and errored named map instantiations 2020-04-30 13:09:12 +02:00
Daniel García Aubert
8d73571f5b Simplify assertions 2020-04-30 12:31:12 +02:00
Daniel García Aubert
d5348dd9d4 Rename fields from headers of metrics 2020-04-29 18:48:10 +02:00
Daniel García Aubert
7e31b956bf Send stat_tag metric when available 2020-04-29 18:25:01 +02:00
Daniel García Aubert
dbc5d65d90 Send template_hash as part of the metrics event 2020-04-29 17:26:33 +02:00
Daniel García Aubert
c91d78fe51 Also export template hash 2020-04-29 16:44:14 +02:00
Daniel García Aubert
798d010776 Ensure "map_id" and "cache_buster" as part of the event 2020-04-29 14:32:08 +02:00
Daniel García Aubert
70f0b6ea50 Avoid to use "pubsub" for the name of modules, middlewares, variables, etc.. 2020-04-29 10:40:45 +02:00
Daniel García Aubert
4e3ef96374 Add test to chek we still send events when errored map static tile 2020-04-29 10:28:10 +02:00
Daniel García Aubert
c88a14bf43 Send metrics for map instantiations (named, anonymous and static) with the new format. 2020-04-28 19:17:00 +02:00
Daniel García Aubert
7f5ed58a79 Add test 2020-04-27 18:40:28 +02:00
Daniel García Aubert
89e349146d Fix tests and stop using sinon as a dev dependency 2020-04-27 18:02:06 +02:00
Daniel García Aubert
c5cb2ea4cb Add FIXME comment 2020-04-27 13:35:19 +02:00
Daniel García Aubert
fe9610abe9 Missing logger argument 2020-04-27 13:35:07 +02:00
Daniel García Aubert
1bbde4f5e3 Let to the caller to choose how to handle the call to a method 2020-04-27 13:27:05 +02:00
Daniel García Aubert
e90c196598 Simplified metrics middleware and backend 2020-04-27 12:46:27 +02:00
Daniel García Aubert
6a2333be64 Topic name's lifetime is longer than pubsub backend, we can keep it as property. 2020-04-27 12:13:54 +02:00
Daniel García Aubert
7d6a64d383 Do not expose functions just to be able to mock them while testing 2020-04-27 11:59:36 +02:00
Daniel García Aubert
42dc2915ea Send pubsub metrics once the response has finished 2020-04-27 11:41:37 +02:00
Daniel García Aubert
3cec6b5a90 Missing callback 2020-04-27 11:06:09 +02:00
Daniel García Aubert
c31e3d6e3f Consistent interface when returning no event for eventa data in metrics 2020-04-27 10:58:37 +02:00
Daniel García Aubert
6e4c8a6639 Follow Node.js callback pattern 2020-04-27 10:23:11 +02:00