Custom metrics in Dynatrace

310 views Asked by At

I want to use the Dynatrace monitoring system. I have researched a little monitoring of the Spring application using a Micrometer + Prometheus + Grafana. In this case, when we creating custom metrics (for example, a counter), we must write in the code, for example:

Counter counter = Counter
  .builder("instance")
  .description("indicates instance count of the object")
  .tags("dev", "performance")
  .register(registry);

counter.increment(2.0);
 
assertTrue(counter.count() == 2);
 
counter.increment(-1);
 
assertTrue(counter.count() == 1);

I have a question: how can I make custom metric using Dynatrace? I could not find examples of code. For example, I need a custom counter metric. How can I create this in my Java code?

0

There are 0 answers