[CORL-1075] Metrics Cleanup (#2955)

* feat: added support for metrics on another port

* fix: handle cluster better

* fix: linting
This commit is contained in:
Wyatt Johnson
2020-05-11 21:01:53 +00:00
committed by GitHub
parent d0ab2ef8c5
commit 1f69bb2f14
6 changed files with 101 additions and 124 deletions
+7 -10
View File
@@ -180,16 +180,13 @@ export function formatResponse(
// Log out the query.
logQuery(context, query, persisted);
// Increment the metrics if enabled.
if (metrics) {
// Get the request metadata.
const { operation, operationName } = getOperationMetadata(query);
if (operation && operationName) {
// Increment the graph query value, tagging with the name of the query.
metrics.executedGraphQueriesTotalCounter
.labels(operation, operationName)
.inc();
}
// Get the request metadata.
const { operation, operationName } = getOperationMetadata(query);
if (operation && operationName) {
// Increment the graph query value, tagging with the name of the query.
metrics.executedGraphQueriesTotalCounter
.labels(operation, operationName)
.inc();
}
if (value.errors && value.errors.length > 0) {