feat(monitoring): add graphql error and call metrics at startup time (#7226)

This commit is contained in:
Peter Szalai 2023-02-06 15:38:35 +01:00 committed by GitHub
parent 2cac149862
commit 36b6fce46c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,8 @@ import org.springframework.web.bind.annotation.RestController;
public class GraphQLController {
public GraphQLController() {
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "error"));
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "call"));
}
@Inject
@ -148,6 +149,7 @@ public class GraphQLController {
private void submitMetrics(ExecutionResult executionResult) {
try {
observeErrors(executionResult);
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "call")).inc();
Object tracingInstrumentation = executionResult.getExtensions().get("tracing");
if (tracingInstrumentation instanceof Map) {
Map<String, Object> tracingMap = (Map<String, Object>) tracingInstrumentation;