micrometer
micrometer copied to clipboard
Migrate to JOOQ 3.15
It seems 3.15 brought in some breaking changes, so we needed to lock 3.14 in, see: https://github.com/micrometer-metrics/micrometer/pull/2685
Here's the error output: console log
For your information, jOOQ 3.15.0 requires Java 11 in OSS Edition.
See https://www.jooq.org/notes#3.15.0
Obviously, micrometer crashes with jOOQ 3.16 and 3.17 as well:
Exception in thread "main" java.lang.AbstractMethodError: Receiver class io.micrometer.core.instrument.binder.db.MetricsDSLContext does not define or inherit an implementation of the resolved method 'abstract org.jooq.SelectWhereStep selectFrom(org.jooq.TableLike)' of interface org.jooq.DSLContext.
Is anyone willing to work on this? jOOQ 3.14 is no longer supported and I can imagine this is blocking an upgrade for many folks.
Due to the approach we've taken to instrument metrics with jooq (proxying DSLContext), we're highly likely going to have breaking changes in each minor release to deal with (or so the experience seems so far), which means dropping support for previous minor versions of jooq. This doesn't feel great for users, but I don't know a better approach to take in Micrometer at this time.
It seems like we could avoid the pain we are experiencing if we could adapt the instrumentation to extend DefaultDSLContext rather than proxy DSLContext, but that might be impossible given the current usage.
Pull requests would be welcome to either bump the version of jooq and adapt to the changes in DSLContext, or propose a different approach that results in better compatibility.
You know, you could instead use jOOQ's Execution Listeners, I think that's what they are designed for - https://www.jooq.org/doc/latest/manual/sql-execution/execute-listeners/ Plus the record listeners for the UpdatableRecord API https://www.jooq.org/doc/latest/manual/sql-execution/crud-with-updatablerecords/crud-record-listener/
Intercepting only the calls coming through the DSLContext would totally miss the Record API, if I'm not mistaken.
Under the hood, we are using an execute listener already. That's essentially what is being configured with the MetricsDSLContext while providing additional API to set tags.
Currently we're not planning to upgrade due to e.g. JDK 11 requirement
If we can't upgrade because of the minimum JDK version and the version we are compatible with is long out of support, it sounds like our only reasonable option is to deprecated our jooq instrumentation for removal. It would need to go to a separate module that can be JDK 11 baseline. I believe we previously asked about having the instrumentation in jooq and there wasn't an appetite for it. We could ask again, but I don't see a reason to maintain it in micrometer-core if it only works with an unsupported version.
Makes sense, created another issue here