diff --git a/dialogue-core/src/main/java/com/palantir/dialogue/core/RequestSizeMetricsChannel.java b/dialogue-core/src/main/java/com/palantir/dialogue/core/RequestSizeMetricsChannel.java index b6cf07784..b7c1a0c58 100644 --- a/dialogue-core/src/main/java/com/palantir/dialogue/core/RequestSizeMetricsChannel.java +++ b/dialogue-core/src/main/java/com/palantir/dialogue/core/RequestSizeMetricsChannel.java @@ -47,13 +47,20 @@ static EndpointChannel create(Config cf, EndpointChannel channel, Endpoint endpo EndpointChannel delegate, String channelName, Endpoint endpoint, TaggedMetricRegistry registry) { this.delegate = delegate; DialogueClientMetrics dialogueClientMetrics = DialogueClientMetrics.of(registry); - DialogueClientMetrics.RequestsSizeBuilderRetryableStage requestSize = dialogueClientMetrics + this.retryableRequestSize = dialogueClientMetrics .requestsSize() .channelName(channelName) .serviceName(endpoint.serviceName()) - .endpoint(endpoint.endpointName()); - this.retryableRequestSize = requestSize.retryable("true").build(); - this.nonretryableRequestSize = requestSize.retryable("false").build(); + .endpoint(endpoint.endpointName()) + .retryable("true") + .build(); + this.nonretryableRequestSize = dialogueClientMetrics + .requestsSize() + .channelName(channelName) + .serviceName(endpoint.serviceName()) + .endpoint(endpoint.endpointName()) + .retryable("false") + .build(); } @Override diff --git a/dialogue-core/src/test/java/com/palantir/dialogue/core/RequestSizeMetricsChannelTest.java b/dialogue-core/src/test/java/com/palantir/dialogue/core/RequestSizeMetricsChannelTest.java index 1a814d114..ff03e20d9 100644 --- a/dialogue-core/src/test/java/com/palantir/dialogue/core/RequestSizeMetricsChannelTest.java +++ b/dialogue-core/src/test/java/com/palantir/dialogue/core/RequestSizeMetricsChannelTest.java @@ -101,8 +101,10 @@ public void close() {} assertThat(response.get().code()).isEqualTo(200); Snapshot snapshot = DialogueClientMetrics.of(registry) .requestsSize() + .channelName("channelName") .serviceName("service") .endpoint("endpoint") + .retryable("true") .build() .getSnapshot(); assertThat(snapshot.size()).isEqualTo(1);