Skip to content

Commit

Permalink
Merge pull request #7694 from DataDog/mhlidd/client_error_statuses
Browse files Browse the repository at this point in the history
Add support for `TRACE_HTTP_CLIENT_ERROR_STATUSES`
  • Loading branch information
mhlidd authored Oct 9, 2024
2 parents 3ddea41 + a3e22e1 commit 5886196
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ public final class TracerConfig {
// Use TRACE_HTTP_SERVER_ERROR_STATUSES instead
@Deprecated public static final String HTTP_SERVER_ERROR_STATUSES = "http.server.error.statuses";
public static final String TRACE_HTTP_SERVER_ERROR_STATUSES = "trace.http.server.error.statuses";
public static final String HTTP_CLIENT_ERROR_STATUSES = "http.client.error.statuses";
// Use TRACE_HTTP_CLIENT_ERROR_STATUSES instead
@Deprecated 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
4 changes: 3 additions & 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,9 @@ private Config(final ConfigProvider configProvider, final InstrumenterConfig ins

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

httpServerTagQueryString =
configProvider.getBoolean(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ConfigCollectorTest extends DDSpecification {
// ConfigProvider.getMergedMapWithOptionalMappings
TracerConfig.HEADER_TAGS | "e:five"
// ConfigProvider.getIntegerRange
TracerConfig.HTTP_CLIENT_ERROR_STATUSES | "400-402"
TracerConfig.TRACE_HTTP_CLIENT_ERROR_STATUSES | "400-402"
}

def "should collect merged data from multiple sources"() {
Expand Down Expand Up @@ -95,7 +95,7 @@ class ConfigCollectorTest extends DDSpecification {
GeneralConfig.TELEMETRY_HEARTBEAT_INTERVAL | new Float(DEFAULT_TELEMETRY_HEARTBEAT_INTERVAL).toString()
CiVisibilityConfig.CIVISIBILITY_GRADLE_SOURCE_SETS | "main,test"
IastConfig.IAST_WEAK_HASH_ALGORITHMS | DEFAULT_IAST_WEAK_HASH_ALGORITHMS.join(",")
TracerConfig.HTTP_CLIENT_ERROR_STATUSES | "400-500"
TracerConfig.TRACE_HTTP_CLIENT_ERROR_STATUSES | "400-500"
}

def "default null config settings are also collected"() {
Expand Down

0 comments on commit 5886196

Please sign in to comment.