mirror of
https://github.com/datahub-project/datahub.git
synced 2025-11-11 08:52:58 +00:00
feat(monitoring): add graphql error and call metrics at startup time (#7226)
This commit is contained in:
parent
2cac149862
commit
36b6fce46c
@ -36,7 +36,8 @@ import org.springframework.web.bind.annotation.RestController;
|
|||||||
public class GraphQLController {
|
public class GraphQLController {
|
||||||
|
|
||||||
public GraphQLController() {
|
public GraphQLController() {
|
||||||
|
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "error"));
|
||||||
|
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "call"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@ -148,6 +149,7 @@ public class GraphQLController {
|
|||||||
private void submitMetrics(ExecutionResult executionResult) {
|
private void submitMetrics(ExecutionResult executionResult) {
|
||||||
try {
|
try {
|
||||||
observeErrors(executionResult);
|
observeErrors(executionResult);
|
||||||
|
MetricUtils.get().counter(MetricRegistry.name(this.getClass(), "call")).inc();
|
||||||
Object tracingInstrumentation = executionResult.getExtensions().get("tracing");
|
Object tracingInstrumentation = executionResult.getExtensions().get("tracing");
|
||||||
if (tracingInstrumentation instanceof Map) {
|
if (tracingInstrumentation instanceof Map) {
|
||||||
Map<String, Object> tracingMap = (Map<String, Object>) tracingInstrumentation;
|
Map<String, Object> tracingMap = (Map<String, Object>) tracingInstrumentation;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user