Fix service tag by avoiding using a reserved tag name (#8472)

This commit is contained in:
Alexandre Yang 2019-09-06 00:43:09 +02:00 committed by Clint Wylie
parent bffaca672a
commit 7f28561d17
2 changed files with 2 additions and 2 deletions

View File

@ -103,7 +103,7 @@ public class StatsDEmitter implements Emitter
ImmutableMap.Builder<String, String> dimsBuilder = new ImmutableMap.Builder<>(); ImmutableMap.Builder<String, String> dimsBuilder = new ImmutableMap.Builder<>();
if (config.isDogstatsd() && config.isDogstatsdServiceAsTag()) { if (config.isDogstatsd() && config.isDogstatsdServiceAsTag()) {
dimsBuilder.put("service", service); dimsBuilder.put("druid_service", service);
nameBuilder.add(DRUID_DEFAULT_PREFIX); nameBuilder.add(DRUID_DEFAULT_PREFIX);
} else { } else {
nameBuilder.add(service); nameBuilder.add(service);

View File

@ -181,7 +181,7 @@ public class StatsDEmitterTest
client client
); );
client.time("druid.query.time", 10, client.time("druid.query.time", 10,
"service:druid/broker", "dataSource:data-source", "type:groupBy", "hostname:brokerHost1" "druid_service:druid/broker", "dataSource:data-source", "type:groupBy", "hostname:brokerHost1"
); );
EasyMock.replay(client); EasyMock.replay(client);
emitter.emit(new ServiceMetricEvent.Builder() emitter.emit(new ServiceMetricEvent.Builder()