diff --git a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonDataWriter.java b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonDataWriter.java index af2f3f6b3f..dd76658a92 100644 --- a/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonDataWriter.java +++ b/apm-agent-core/src/main/java/co/elastic/apm/agent/report/serialize/DslJsonDataWriter.java @@ -117,4 +117,9 @@ public int size() { public void report() { reporter.reportMetrics(jw); } + + @Override + public String toString() { + return jw.toString(); + } } diff --git a/apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerMeterRegistrySerializerTest.java b/apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerMeterRegistrySerializerTest.java index 5481763853..f47dc58f5b 100644 --- a/apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerMeterRegistrySerializerTest.java +++ b/apm-agent-plugins/apm-micrometer-plugin/src/test/java/co/elastic/apm/agent/micrometer/MicrometerMeterRegistrySerializerTest.java @@ -65,8 +65,8 @@ static void setup() { when(tracer.newWriter(anyInt())).thenAnswer(new Answer() { @Override public DataWriter answer(InvocationOnMock invocationOnMock) { - int size = invocationOnMock.getArgument(0); - return new DslJsonDataWriter(dslJson.newWriter(size), reporter); + int maxSerializedSize = invocationOnMock.getArgument(0); + return new DslJsonDataWriter(dslJson.newWriter(maxSerializedSize), reporter); } }); serializer = new MicrometerMeterRegistrySerializer(config, tracer);