Unable to publish custom metrics using micrometer. Error: "Could not map JSON at .."

Hello Team,

I’m trying to publish my Spring Boot application metrics using micrometer. I have completed adding required code and on running the code, I see the following error:

[dynatrace-metrics-publisher] ERROR io.micrometer.dynatrace.DynatraceMeterRegistry.lambda$postCustomMetricValues$6 (249) - failed to send metrics to dynatrace: {"error":{"code":400,"message":"Could not map JSON at 'series[56].dataPoints' near line 1 column 12884"}}

Can you please help here in fixing the issue?

Thanks,

DB

Hello,

Could you please provide more information as to what code you added and the steps you took?

-Ryan

hi @ryan_ott ,

I think I could find the issue. I was following the steps as documented in: https://micrometer.io/docs/registry/dynatrace

I had to lower the “micrometer-registry-dynatrace” version to get it working. I initially had started with the latest version of maven artifact.

<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-dynatrace -->
<dependency>
    <groupId>io.micrometer</groupId>
    <artifactId>micrometer-registry-dynatrace</artifactId>
    <version>1.1.1</version>
</dependency>

Hello! I just wanted to let you know - and for future references - that we have published a new version of the micrometer registry for Dynatrace: https://micrometer.io/docs/registry/dynatrace, with simplified deployment and that automatically connecting your Micrometer metrics to the topology.

Documentation: Send Micrometer metrics to Dynatrace — Dynatrace Docs

Sonja