From e1b475ecf76959033059c04abca21c45ae1a1df8 Mon Sep 17 00:00:00 2001 From: Jonatan Ivanov Date: Thu, 22 Aug 2024 17:21:33 -0700 Subject: [PATCH] Add check for DB remote service name Should not be null except if we are not able to connect to the DB. --- .../teahouse/core/actuator/config/CommonActuatorConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/example/teahouse/core/actuator/config/CommonActuatorConfig.java b/core/src/main/java/org/example/teahouse/core/actuator/config/CommonActuatorConfig.java index 1cbdd9c..70bc680 100644 --- a/core/src/main/java/org/example/teahouse/core/actuator/config/CommonActuatorConfig.java +++ b/core/src/main/java/org/example/teahouse/core/actuator/config/CommonActuatorConfig.java @@ -85,7 +85,7 @@ static class DataSourceActuatorConfig { ObservationFilter tempoServiceGraphFilter() { // TODO: remove this once Tempo is fixed: https://github.com/grafana/tempo/issues/2212 return context -> { - if (context instanceof DataSourceBaseContext dataSourceContext) { + if (context instanceof DataSourceBaseContext dataSourceContext && dataSourceContext.getRemoteServiceName() != null) { context.addHighCardinalityKeyValue(KeyValue.of("db.name", dataSourceContext.getRemoteServiceName())); } return context;