You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a CDI bean is annotated with @Named then its public methods annotated with @Counted or @Metered or @Timed annotations are not considered for Microprofile /metrics/application URL.
Example, these metrics are NOT listed in output.
Just remove @Named and all works fine.
@Path("/mailstatus")
@RequestScoped
@Named
public class MailStatusResource
{
@POST
@Path("/")
@Consumes(MediaType.APPLICATION_JSON)
@Counted(name="saveMailStatusCounted")
@Timed(name="saveMailStatusTimed", unit = MetricUnits.MILLISECONDS)
@Metered(name="saveMailStatusMetered", unit = MetricUnits.MINUTES)
public void saveMailStatus(@Valid @Size(min=1, max=2_000_000) String data, @Suspended final AsyncResponse resp)
{
...
Expected Outcome
metrics listed on MP /metrics/application URL output
Current Outcome
no metrics listed on MP /metrics/application URL output, it is empty.
Steps to reproduce (Only for bug reports)
Just add the @Named annotation to any CDI managed class which expose a MP metrics annotation.
Samples
Environment
Payara Version: 5.2020.1
Edition: full / micro
JDK Version: 11.0.x
Operating System: linux
Database: n/a
The text was updated successfully, but these errors were encountered:
I can confirm the behaviour that you report in this issue.
I have created the internal ticket FISH-300 to have a closer look at the problem.
Can you indicate why you would like to have the JAX-RS resources also as named CDI beans (as that is uncommon)
Regards
Rudy
rdebusscher
changed the title
microprofile metrics annotations ignored when using @Named
microprofile metrics annotations ignored when using @Named /FISH-300
Jul 27, 2020
Actually it was an error of my new bean template which include @Named for use with JSF, I simply did not remove it when I created the JAX RS resource. Later I removed the @Named on my JAX-RS bean :-)
fturizo
removed
the
Status: Accepted
Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev
label
Jun 23, 2021
Considering that the user has solved the problem on their end, we consider this no longer an issue to prioritize for a fix, so we'll proceed to close it.
Description
When a CDI bean is annotated with
@Named
then its public methods annotated with@Counted
or@Metered
or@Timed
annotations are not considered for Microprofile /metrics/application URL.Example, these metrics are NOT listed in output.
Just remove
@Named
and all works fine.Expected Outcome
metrics listed on MP /metrics/application URL output
Current Outcome
no metrics listed on MP /metrics/application URL output, it is empty.
Steps to reproduce (Only for bug reports)
Just add the
@Named
annotation to any CDI managed class which expose a MP metrics annotation.Samples
Environment
The text was updated successfully, but these errors were encountered: