-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Questions/Problems regarding commons-dbcp2 metrics #2593
Comments
We still have #1710 open for specifically supporting metrics of Apache DBCP2. It was suggested in #1712 that the |
With the configuration I described you actually get metrics from DBCP2 - I should have been more clear about that. You "just" will see a lot of errors in the log 😬
Maybe the DBCP2 devs will be able to provide some guidance too? |
Hi, I am seeing this bug in my code today with latest versions. Is there any updates? Thanks! |
Latest Micrometer and latest DBCP2? |
@jonatan-ivanov Hi thanks for the reply! I will check that |
Hi there ! I noticed that as of version This seems to be a deliberate choice - though I could not find an explanation/motivation in the respective mailing lists This would make it quite easy to instrument because There's a couple of ways how to go forward:
I'd be willing to contribute since instrumenting dbcp would greatly benefit the app I'm currently maintaining (I have 0 experience with the Observation api though). But I'm not sure If you - in the long term - would rather like to see libraries provide instrumentation themselves and thus reduce the maintainance burden on micrometer. On the other hand recent PRs auch as #4037 have put in a lot of effort in improving 3rd-party libs instrumentation 🤔 Thoughts @jonatan-ivanov ? |
I ran into the same "missing the FactoryType attribute" issue when I was using |
I can think of one reason: If you happen to have more than one object pool in your application for different purposes (some libraries use the pool under the hood) it is hard if not impossible to distinguish between different pools in the metrics. |
The |
#5316 was merged, which should address the FactoryType issue. What's the remaining issue for getting metrics on BasicDataSource? I understand now things go through JMX and that needs to be configured on the BasicDataSource. Are things not working when doing that with the latest versions of Micrometer? I agree an option to directly bind metrics for a |
Hi everybody,
first of all thanks for working on micrometer - it is a true lifesaver 😃
I'm having trouble getting metrics out of apache commons dbcp2 data sources. I've set up a minimal working example to illustrate my problems.
Problem description
Disclaimer - I am terribly unfamiliar with JMX so it is very much possible, that this is the root cause of the problem.
I've configured the
org.apache.commons.dbcp2.BasicDataSource
with the following JMX-name:org.apache.commons.pool2:name=dbcp,type=GenericObjectPool
.After a little bit of digging through the source code of
BasicDataSource
this is necessary as JXM will not be enabled otherwise (this seems strange to me because the "vanilla"GenericObjectPool
has a different behaviour).If my understanding of
CommonsObjectPool2Metrics
is correct this name pattern is necessary in order for Micrometer to register this pool ?When running the application (or the test in my example repo) I encounter the following erros in the log:
It seems that:
FactoryType
is not set by dbcp2name
propertySo my questions are:
MeterBinder
for commons dbcp2 that will handle the (JMX)-specific more explicitly? Or shouldCommonsObjectPool2Metrics
be more graceful/resillient/configurable?Thanks a lot in advance 👍
The text was updated successfully, but these errors were encountered: