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

Introspect metrics annotations from an implemented interface #283

Open
kifj opened this issue Mar 25, 2020 · 2 comments
Open

Introspect metrics annotations from an implemented interface #283

kifj opened this issue Mar 25, 2020 · 2 comments
Labels
innovation-candidate Something not in the spec and SmallRye could serve for verifying usefulness before backporting it

Comments

@kifj
Copy link

kifj commented Mar 25, 2020

given an interface (PetApi) and an implementation (PetResource implements PetApi) for a JAX-RS resource.

In Wildfly 19:

  • when I annotate the implementation class, the annotations are not discovered. When I call the method, no metric appears on the /metrics url.
  • when I annotate the interface, the annotations are discovered, but not updated by requests. All metrics are displayed on the /metrics url, the values are 0.
  • when I annotate the interface and the implementation with the same annotations, the annotations are discovered and return values for requests. In this case I have to mark the annotations as reusable = true. Reading the /metrics url gives all annotated metrics with values.

see also eclipse/microprofile-metrics#451 for a discussion what should be expected behavior in the spec.

  • The Microprofile Restclient allows to annotate the interface (there is no implementation class in this case)
  • The examples for Microprofile Metrics always use JAX-RS implementation classes without interfaces.
@jmartisk
Copy link
Member

jmartisk commented Apr 1, 2020

The spec doesn't basically say anything about this at the moment. And while discussing this within the specification repo, we've come across several potential issues and inconsistencies that could arise from this - feel free to chime in there, but I doubt that a feature like this is coming to the spec any time soon.
We could try to do some basic slimmed down support for it in SmallRye. I'm not opposed to that, just thinking whether there would be any volunteers to come up with a pull request ;)
If we do this in SmallRye first and it proves useful, it can be backported to the spec later.

@kifj kifj closed this as completed Apr 10, 2020
@jmartisk
Copy link
Member

Hey, let's keep this open, if you don't mind! I think this is a valid suggestion.
Perhaps we could find a volunteer to look into it, or I can do that later. Once proved useful in SmallRye, it can be ported to the spec.

@jmartisk jmartisk reopened this Apr 16, 2020
@jmartisk jmartisk added the innovation-candidate Something not in the spec and SmallRye could serve for verifying usefulness before backporting it label Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
innovation-candidate Something not in the spec and SmallRye could serve for verifying usefulness before backporting it
Projects
None yet
Development

No branches or pull requests

2 participants