add prometheus metrics



git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-aggregator-portal/trunk@55839 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
argiro.kokogiannaki 2019-05-28 13:27:12 +00:00
parent f773e0ca7e
commit a2daeed004
2 changed files with 79 additions and 75 deletions

View File

@ -46,31 +46,31 @@ export class Prometheus {
help: 'organization Landing Page Counter',
registers: [this.register]
})],
["/participate/deposit-datasets", new prom.Counter({
name: 'participate_deposit_datasets',
help: 'Participate Deposit Datasets Page Counter',
registers: [this.register]
})],
["/participate/deposit-datasets-result", new prom.Counter({
name: 'participate_deposit_datasets_result',
help: 'Participate Deposit Datasets Result Page Counter',
registers: [this.register]
})],
["/participate/deposit-subject-result", new prom.Counter({
name: 'participate_deposit_subject_result',
help: 'Participate Deposit Subject Result Page Counter',
registers: [this.register]
})],
["/participate/deposit-publications", new prom.Counter({
name: 'participate_deposit_publications',
help: 'Participate Deposit Publications Page Counter',
registers: [this.register]
})],
["/participate/deposit-publications-result", new prom.Counter({
name: 'participate_deposit_publications_result',
help: 'Participate Deposit Publications Result Page Counter',
registers: [this.register]
})],
// ["/participate/deposit-datasets", new prom.Counter({
// name: 'participate_deposit_datasets',
// help: 'Participate Deposit Datasets Page Counter',
// registers: [this.register]
// })],
// ["/participate/deposit-datasets-result", new prom.Counter({
// name: 'participate_deposit_datasets_result',
// help: 'Participate Deposit Datasets Result Page Counter',
// registers: [this.register]
// })],
// ["/participate/deposit-subject-result", new prom.Counter({
// name: 'participate_deposit_subject_result',
// help: 'Participate Deposit Subject Result Page Counter',
// registers: [this.register]
// })],
// ["/participate/deposit-publications", new prom.Counter({
// name: 'participate_deposit_publications',
// help: 'Participate Deposit Publications Page Counter',
// registers: [this.register]
// })],
// ["/participate/deposit-publications-result", new prom.Counter({
// name: 'participate_deposit_publications_result',
// help: 'Participate Deposit Publications Result Page Counter',
// registers: [this.register]
// })],
["/search/find", new prom.Counter({
name: 'search_find',
help: 'Main Search Page Counter',
@ -111,36 +111,36 @@ export class Prometheus {
help: 'Organizations Search Page Counter',
registers: [this.register]
})],
["/search/content-providers", new prom.Counter({
name: 'search_content_providers',
help: 'Repositories Search Page Counter',
registers: [this.register]
})],
["/search/content-providers-table", new prom.Counter({
name: 'search_content_providers_table',
help: 'Repositories Search Page Table Counter',
registers: [this.register]
})],
["/search/entity-registries", new prom.Counter({
name: 'search_entity_registries',
help: 'Registries Search Page Counter',
registers: [this.register]
})],
["/search/entity-registries-table", new prom.Counter({
name: 'search_entity_registries_table',
help: 'Registries Search Page Table Counter',
registers: [this.register]
})],
["/search/journals", new prom.Counter({
name: 'search_journals',
help: 'Journals Search Page Counter',
registers: [this.register]
})],
["/search/journals-table", new prom.Counter({
name: 'search_journals_table',
help: 'Journals Search Page Table Counter',
registers: [this.register]
})],
// ["/search/content-providers", new prom.Counter({
// name: 'search_content_providers',
// help: 'Repositories Search Page Counter',
// registers: [this.register]
// })],
// ["/search/content-providers-table", new prom.Counter({
// name: 'search_content_providers_table',
// help: 'Repositories Search Page Table Counter',
// registers: [this.register]
// })],
// ["/search/entity-registries", new prom.Counter({
// name: 'search_entity_registries',
// help: 'Registries Search Page Counter',
// registers: [this.register]
// })],
// ["/search/entity-registries-table", new prom.Counter({
// name: 'search_entity_registries_table',
// help: 'Registries Search Page Table Counter',
// registers: [this.register]
// })],
// ["/search/journals", new prom.Counter({
// name: 'search_journals',
// help: 'Journals Search Page Counter',
// registers: [this.register]
// })],
// ["/search/journals-table", new prom.Counter({
// name: 'search_journals_table',
// help: 'Journals Search Page Table Counter',
// registers: [this.register]
// })],
["/search/advanced/publications", new prom.Counter({
name: 'search_advanced_publications',
help: 'Publications Advanced Search Page Counter',
@ -176,25 +176,25 @@ export class Prometheus {
help: 'Organizations Advanced Search Page Counter',
registers: [this.register]
})],
["/myclaims", new prom.Counter({
name: 'my_claims',
help: 'My Claims Page Counter',
registers: [this.register]
})],
["/claims", new prom.Counter({
name: 'claims',
help: 'Admin Claims Page Counter',
registers: [this.register]
})],
["/participate/claim", new prom.Counter({
name: 'participate_claim',
help: 'Linking Page Counter',
registers: [this.register]
})],
["/participate/direct-claim", new prom.Counter({
name: 'participate_direct_claim',
help: 'Direct Linking Page Counter',
registers: [this.register]
})]
// ["/myclaims", new prom.Counter({
// name: 'my_claims',
// help: 'My Claims Page Counter',
// registers: [this.register]
// })],
// ["/claims", new prom.Counter({
// name: 'claims',
// help: 'Admin Claims Page Counter',
// registers: [this.register]
// })],
// ["/participate/claim", new prom.Counter({
// name: 'participate_claim',
// help: 'Linking Page Counter',
// registers: [this.register]
// })],
// ["/participate/direct-claim", new prom.Counter({
// name: 'participate_direct_claim',
// help: 'Direct Linking Page Counter',
// registers: [this.register]
// })]
]);
}

View File

@ -65,6 +65,10 @@ app.get('*.*', express.static(join(DIST_FOLDER, 'browser'), {
maxAge: '1y'
}));
app.get('/metrics', (req, res) => {
res.set('Content-Type', prometheus.register.contentType);
res.end(prometheus.register.metrics());
});
// All regular routes use the Universal engine
app.get('*', (req, res) => {
let start = new Date();