eclipse / microprofile-metrics

microprofile-metrics
Apache License 2.0
100 stars 66 forks source link

Missing value `monotonic = true` when using [MicroProfile @counted] annotation #499

Closed thomassuedbroecker closed 4 years ago

thomassuedbroecker commented 4 years ago

Problem:

When I update from MicroProfile 2.1. to MicroProfile 3.0. the value monotonic = true is missing, when we use the [MicroProfile @counted] annotation (https://github.com/eclipse/microprofile-metrics/blob/master/api/src/main/java/org/eclipse/microprofile/metrics/annotation/Counted.java)

@Counted(name = "getArticlesCounted",
            absolute = true,
            displayName = "web-api /getmultiple count",
            description = "Number of times com.ibm.webapi.apis.GetArticles.getArticles has been invoked",
            monotonic = true)
ERROR] /usr/src/app/src/main/java/com/ibm/webapi/apis/GetArticles.java:[53,29] cannot find symbol
  symbol:   method monotonic()
  location: @interface org.eclipse.microprofile.metrics.annotation.Counted
[INFO] 1 error

countered-monotonic

Configuration:

Related documentation in openliberty.

pilhuhn commented 4 years ago

This is an intentional change in MP-2.0 because the old default behaviour was @Counted(monotonic=false), which is not what folks expected. In 2.0 this changed and @Counted is always monotonic. If you need the monotonic=false behaviour, then have a look at @ConcurrentGauge