eclipse / microprofile-metrics

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

Clarify rules for gauge injection #571

Closed jmartisk closed 4 years ago

jmartisk commented 4 years ago

@jbee please have a look

Metric commented 4 years ago

If you could not use @Metric in your replies when it is related to your logging. Would be fantastic. You wouldn’t believe all the convos I get included on due to this stupid logger syntax.

Thanks, Metric

On Tue, May 5, 2020 at 6:32 PM David Chan notifications@github.com wrote:

@Channyboy commented on this pull request.

In spec/src/main/asciidoc/app-programming-model.adoc https://github.com/eclipse/microprofile-metrics/pull/571#discussion_r420468032 :

@@ -579,8 +580,12 @@ Gauge hitPercentage = new Gauge() { };

-When a metric injected field is annotated, the implementation must provide the registered metric with the given name (using the <>) if the metric already exist. If no metric exists with the given name then the implementation must produce and register the requested metric. -@Metric can only be used on injected fields of type Meter, Timer, Counter, and Histogram.

I think the original text might've wanted to clarify that the @Inject https://github.com/Inject and @Metric https://github.com/Metric wouldn't create/produce and register a gauge for you after just saying the implementation would "produce and register the requested metrics" if it didn't exist.

The new text sort of does imply this isn't the case. But maybe it might clear it up if we explicitly say Gauges aren't produced and registered, but rather have a proxy gauge etc etc.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/eclipse/microprofile-metrics/pull/571#discussion_r420468032, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAB5I3NC2TUBGWWRFNWBJFLRQCOXTANCNFSM4MHPTOUQ .