Skip to content

Commit bd6a418

Browse files
committed
Addressing review feedback
- fix null handling for http method & endpoint - increase service source cache size
1 parent b453f26 commit bd6a418

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • dd-trace-core/src/main/java/datadog/trace/common/metrics

dd-trace-core/src/main/java/datadog/trace/common/metrics/MetricKey.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
public final class MetricKey {
1414
static final DDCache<String, UTF8BytesString> RESOURCE_CACHE = DDCaches.newFixedSizeCache(32);
1515
static final DDCache<String, UTF8BytesString> SERVICE_CACHE = DDCaches.newFixedSizeCache(8);
16-
static final DDCache<String, UTF8BytesString> SERVICE_SOURCE_CACHE = DDCaches.newFixedSizeCache(4);
16+
static final DDCache<String, UTF8BytesString> SERVICE_SOURCE_CACHE = DDCaches.newFixedSizeCache(16);
1717
static final DDCache<String, UTF8BytesString> OPERATION_CACHE = DDCaches.newFixedSizeCache(64);
1818
static final DDCache<String, UTF8BytesString> TYPE_CACHE = DDCaches.newFixedSizeCache(8);
1919
static final DDCache<String, UTF8BytesString> KIND_CACHE = DDCaches.newFixedSizeCache(8);
@@ -57,8 +57,8 @@ public MetricKey(
5757
this.isTraceRoot = isTraceRoot;
5858
this.spanKind = utf8(KIND_CACHE, spanKind);
5959
this.peerTags = peerTags == null ? Collections.emptyList() : peerTags;
60-
this.httpMethod = utf8(HTTP_METHOD_CACHE, httpMethod);
61-
this.httpEndpoint = utf8(HTTP_ENDPOINT_CACHE, httpEndpoint);
60+
this.httpMethod = httpMethod == null ? null : utf8(HTTP_METHOD_CACHE, httpMethod);
61+
this.httpEndpoint = httpEndpoint == null ? null : utf8(HTTP_ENDPOINT_CACHE, httpEndpoint);
6262

6363
int tmpHash = 0;
6464
tmpHash = HashingUtils.addToHash(tmpHash, this.isTraceRoot);

0 commit comments

Comments
 (0)