Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

microprofile metrics annotations ignored when using @Named /FISH-300 #4797

Closed
demanzano opened this issue Jul 19, 2020 · 3 comments
Closed
Assignees
Labels
Type: Bug Label issue as a bug defect

Comments

@demanzano
Copy link

demanzano commented Jul 19, 2020

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.

@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
@rdebusscher rdebusscher self-assigned this Jul 27, 2020
@rdebusscher
Copy link

Hi,

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 rdebusscher changed the title microprofile metrics annotations ignored when using @Named microprofile metrics annotations ignored when using @Named /FISH-300 Jul 27, 2020
@rdebusscher rdebusscher added the Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev label Jul 27, 2020
@demanzano
Copy link
Author

hi,

thanks for feedback!

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 :-)

Kind regards
Ale

@fturizo fturizo added the Type: Bug Label issue as a bug defect label Nov 12, 2020
@Pandrex247 Pandrex247 assigned fturizo and unassigned rdebusscher Jun 22, 2021
@fturizo fturizo removed the Status: Accepted Confirmed defect or accepted improvement to implement, issue has been escalated to Platform Dev label Jun 23, 2021
@fturizo
Copy link
Contributor

fturizo commented 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.

@fturizo fturizo closed this as completed Jun 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Label issue as a bug defect
Projects
None yet
Development

No branches or pull requests

3 participants