Rename SERVICE -> SERVICE_TAG constant
To make meaning more clear
MODIFY
dd-trace-api/src/main/java/datadog/trace/api/Config.java
dd-trace-api/src/main/java/datadog/trace/api/Config.java
@@ -44,7 +44,6 @@ public class Config {
public static final String CONFIGURATION_FILE = "trace.config";
public static final String SERVICE_NAME = "service.name";
- public static final String SERVICE = "service";
public static final String TRACE_ENABLED = "trace.enabled";
public static final String INTEGRATIONS_ENABLED = "integrations.enabled";
public static final String WRITER_TYPE = "writer.type";
@@ -90,6 +89,7 @@ public class Config {
public static final String LOGS_INJECTION_ENABLED = "logs.injection";
+ public static final String SERVICE_TAG = "service";
public static final String RUNTIME_ID_TAG = "runtime-id";
public static final String LANGUAGE_TAG_KEY = "language";
public static final String LANGUAGE_TAG_VALUE = "jvm";
@@ -471,7 +471,7 @@ public class Config {
// service name set here instead of getRuntimeTags because apm already manages the service tag
// and may chose to override it.
// Additionally, infra/JMX metrics require `service` rather than APM's `service.name` tag
- result.put(SERVICE, serviceName);
+ result.put(SERVICE_TAG, serviceName);
return Collections.unmodifiableMap(result);
}

MODIFY
dd-trace-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy
dd-trace-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy
@@ -30,9 +30,9 @@ import static datadog.trace.api.Config.PROPAGATION_STYLE_EXTRACT
import static datadog.trace.api.Config.PROPAGATION_STYLE_INJECT
import static datadog.trace.api.Config.RUNTIME_CONTEXT_FIELD_INJECTION
import static datadog.trace.api.Config.RUNTIME_ID_TAG
-import static datadog.trace.api.Config.SERVICE
import static datadog.trace.api.Config.SERVICE_MAPPING
import static datadog.trace.api.Config.SERVICE_NAME
+import static datadog.trace.api.Config.SERVICE_TAG
import static datadog.trace.api.Config.SPAN_TAGS
import static datadog.trace.api.Config.SPLIT_BY_TAGS
import static datadog.trace.api.Config.TRACE_AGENT_PORT
@@ -75,7 +75,7 @@ class ConfigTest extends Specification {
config.traceResolverEnabled == true
config.serviceMapping == [:]
config.mergedSpanTags == [:]
- config.mergedJmxTags == [(RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE): config.serviceName]
+ config.mergedJmxTags == [(RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE_TAG): config.serviceName]
config.headerTags == [:]
config.httpServerErrorStatuses == (500..599).toSet()
config.httpClientErrorStatuses == (400..499).toSet()
@@ -151,7 +151,7 @@ class ConfigTest extends Specification {
config.traceResolverEnabled == false
config.serviceMapping == [a: "1"]
config.mergedSpanTags == [b: "2", c: "3"]
- config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE): config.serviceName]
+ config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE_TAG): config.serviceName]
config.headerTags == [e: "5"]
config.httpServerErrorStatuses == (122..457).toSet()
config.httpClientErrorStatuses == (111..111).toSet()
@@ -218,7 +218,7 @@ class ConfigTest extends Specification {
config.traceResolverEnabled == false
config.serviceMapping == [a: "1"]
config.mergedSpanTags == [b: "2", c: "3"]
- config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE): config.serviceName]
+ config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE_TAG): config.serviceName]
config.headerTags == [e: "5"]
config.httpServerErrorStatuses == (122..457).toSet()
config.httpClientErrorStatuses == (111..111).toSet()
@@ -410,7 +410,7 @@ class ConfigTest extends Specification {
config.traceResolverEnabled == false
config.serviceMapping == [a: "1"]
config.mergedSpanTags == [b: "2", c: "3"]
- config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE): config.serviceName]
+ config.mergedJmxTags == [b: "2", d: "4", (RUNTIME_ID_TAG): config.getRuntimeId(), (SERVICE_TAG): config.serviceName]
config.headerTags == [e: "5"]
config.httpServerErrorStatuses == (122..457).toSet()
config.httpClientErrorStatuses == (111..111).toSet()

Rename SERVICE -> SERVICE_TAG constant

To make meaning more clear