Skip to content

Commit

Permalink
adding string for TRACE_HTTP_CLIENT_ERROR_STATUSES
Browse files Browse the repository at this point in the history
rebasing
  • Loading branch information
mhlidd committed Sep 30, 2024
1 parent 80b17e4 commit c6b378c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ public final class TracerConfig {
"trace.http.client.path-resource-name-mapping";
public static final String HTTP_SERVER_ERROR_STATUSES = "http.server.error.statuses";
public static final String HTTP_CLIENT_ERROR_STATUSES = "http.client.error.statuses";
public static final String TRACE_HTTP_CLIENT_ERROR_STATUSES = "trace.http.client.error.statuses";

public static final String SPLIT_BY_TAGS = "trace.split-by-tags";

Expand Down
2 changes: 1 addition & 1 deletion internal-api/src/main/java/datadog/trace/api/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins

httpClientErrorStatuses =
configProvider.getIntegerRange(
"trace." + HTTP_CLIENT_ERROR_STATUSES, DEFAULT_HTTP_CLIENT_ERROR_STATUSES, HTTP_CLIENT_ERROR_STATUSES);
TRACE_HTTP_CLIENT_ERROR_STATUSES, DEFAULT_HTTP_CLIENT_ERROR_STATUSES, HTTP_CLIENT_ERROR_STATUSES);

httpServerTagQueryString =
configProvider.getBoolean(
Expand Down
14 changes: 14 additions & 0 deletions internal-api/src/test/groovy/datadog/trace/api/ConfigTest.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ import static datadog.trace.api.config.TracerConfig.SPAN_TAGS
import static datadog.trace.api.config.TracerConfig.SPLIT_BY_TAGS
import static datadog.trace.api.config.TracerConfig.TRACE_AGENT_PORT
import static datadog.trace.api.config.TracerConfig.TRACE_AGENT_URL
import static datadog.trace.api.config.TracerConfig.TRACE_HTTP_CLIENT_ERROR_STATUSES
import static datadog.trace.api.config.TracerConfig.TRACE_PROPAGATION_EXTRACT_FIRST
import static datadog.trace.api.config.TracerConfig.TRACE_RATE_LIMIT
import static datadog.trace.api.config.TracerConfig.TRACE_REPORT_HOSTNAME
Expand Down Expand Up @@ -965,6 +966,19 @@ class ConfigTest extends DDSpecification {
integrationNames = new TreeSet<>(names)
}

def "verify precedence of aliases"() {
setup:
def prop = new Properties()
prop.setProperty(HTTP_CLIENT_ERROR_STATUSES, "111")
prop.setProperty(TRACE_HTTP_CLIENT_ERROR_STATUSES, "123")

when:
Config config = Config.get(prop)

then:
config.httpClientErrorStatuses == toBitSet((123..123))
}

def "test getFloatSettingFromEnvironment(#name)"() {
setup:
environmentVariables.set("DD_ENV_ZERO_TEST", "0.0")
Expand Down

0 comments on commit c6b378c

Please sign in to comment.