Skip to content

Metrics not being recorded on TomEE but not starting at all on Payara due to not finding beans #16

@ashri

Description

@ashri

I have a very basic example application using Metrics-CDI found here:

https://github.com/ashri/metrics-cdi-jaxrs

This application just has a hello-world style endpoint which is annotated with @Timer. The application is configured to log the metrics to the console every 5 seconds.

To test the application, first build it with mvn package then after deployment to an app server, run curl http://localhost:8080/metrics-cdi-jaxrs

If you deploy the example to Wildfly 10.1, the application logs metrics as expected.

If you deploy the example to TomEE 7.0.2, the application does log metrics but they are always 0.

If you deploy the example to Payara 172, the application fails to start due to being unable to find the appropriate beans.

I have no idea what is the root cause of the problem.

Payara has a more recent version of the Weld library. TomEE may not be cross-polinating managed beans across the BeanManagers meaning the one injected in the app is not the same MetricRegistry bean the metrics are logging to (wild speculation).

Any assistance with this issue would be greatly appreciated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions