Log stats with the username bound

This commit is contained in:
Daniel García Aubert 2020-07-23 11:58:52 +02:00
parent df604adc2a
commit 1eae4ee41f
3 changed files with 6 additions and 4 deletions

View File

@ -31,9 +31,9 @@ module.exports = class CopyController {
const copyFromMiddlewares = endpointGroup => {
return [
initLogger({ logger: this.logger }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient }),
tag({ tags: ['ingestion', 'copyfrom'] }),
user(this.metadataBackend),
rateLimits(this.userLimitsService, endpointGroup),
authorization(this.metadataBackend),
connectionParams(this.userDatabaseService),
@ -47,10 +47,10 @@ module.exports = class CopyController {
const copyToMiddlewares = endpointGroup => {
return [
initLogger({ logger: this.logger, logOnEvent: 'log' }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient, logOnEvent: 'log' }),
tag({ tags: ['ingestion', 'copyto'], logOnEvent: 'log' }),
bodyParser(),
user(this.metadataBackend),
rateLimits(this.userLimitsService, endpointGroup),
authorization(this.metadataBackend),
connectionParams(this.userDatabaseService),

View File

@ -34,6 +34,7 @@ module.exports = class JobController {
sqlRouter.post('/job', [
initLogger({ logger: this.logger }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient }),
tag({ tags: ['job', 'create'] }),
bodyParser(),
@ -44,6 +45,7 @@ module.exports = class JobController {
sqlRouter.get('/job/:job_id', [
initLogger({ logger: this.logger }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient }),
tag({ tags: ['job', 'retrieve'] }),
bodyParser(),
@ -52,6 +54,7 @@ module.exports = class JobController {
sqlRouter.delete('/job/:job_id', [
initLogger({ logger: this.logger }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient }),
tag({ tags: ['job', 'cancel'] }),
bodyParser(),
@ -65,7 +68,6 @@ function composeJobMiddlewares (metadataBackend, userDatabaseService, jobService
const forceToBeMaster = true;
return [
user(metadataBackend),
rateLimits(userLimitsService, endpointGroup),
authorization(metadataBackend, forceToBeMaster),
connectionParams(userDatabaseService),

View File

@ -40,10 +40,10 @@ module.exports = class QueryController {
const queryMiddlewares = () => {
return [
initLogger({ logger: this.logger }),
user(this.metadataBackend),
profiler({ statsClient: this.statsdClient }),
tag({ tags: ['query'] }),
bodyParser(),
user(this.metadataBackend),
rateLimits(this.userLimitsService, RATE_LIMIT_ENDPOINTS_GROUPS.QUERY),
authorization(this.metadataBackend, forceToBeMaster),
connectionParams(this.userDatabaseService),