question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistent datasource metrics configuration between MP Metrics and Micrometer

See original GitHub issue

Describe the bug

The datasource documentation says

By default, this metric collection mechanism gets turned on for all data sources if a metrics extension is present and metrics for the Agroal extension are enabled.

and the all config options documentation indicate that

quarkus.datasource.jdbc.enable-metrics - If unspecified, collecting metrics will be enabled by default if a metrics extension is active.

However, when using the Micrometer extension quarkus-micrometer it is necessary to explicitly set quarkus.datasource.jdbc.enable-metrics to true, in addition to quarkus.datasource.metrics.enabled=true.

The reason seems to be that quarkus-micrometer does not declare to have the io.quarkus.metrics capability, the same way that the SmallRye metrics extension quarkus-smallrye-metrics does.

Expected behavior

Using the Micrometer extension quarkus-micrometer, Agroal datasource metrics should be collected after setting quarkus.datasource.metrics.enabled=true, with quarkus.datasource.jdbc.enable-metrics left unset.

Actual behavior

quarkus.datasource.jdbc.enable-metrics needs to be explicitly set to true.

How to Reproduce?

No response

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jmartiskcommented, Jan 3, 2022

So the problem is that with SmallRye, metrics are enabled by default for all data sources, but disabled with Micrometer. The javadoc implies that they are enabled in both cases. If we’re not going to change the behavior, the javadoc should be changed, but I think it would make sense to unify this. If the global setting quarkus.datasource.metrics.enabled is true, and that needs to be set explicitly (!), why should we not enable them for all data sources by default? Most microservice apps only have one data source anyway.

0reactions
mjiderhamncommented, Jan 3, 2022

The problem lies in DataSources.applyNewConfiguration … I don’t remember why MP Metrics is handled differently.

Yes, and as far as I could tell mpMetricsPresent was set based on the io.quarkus.metrics capability.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Micrometer Metrics - Quarkus
This guide demonstrates how your Quarkus application can utilize the Micrometer metrics library for runtime and application metrics. Apart from ...
Read more >
Micrometer: Spring Boot 2's new application metrics collector
Micrometer is a dimensional-first metrics collection facade whose aim is to allow you to time, count, and gauge your code with a vendor ......
Read more >
Metrics for Eclipse MicroProfile
The metrics can be hard coded into the server or read from a configuration file or supplied via the Java-API described in Application...
Read more >
UAV in the advent of the twenties: Where we stand and what is ...
Despite the high number of peer-reviewed papers on UAVs, little attention has been given to the interaction between research topics from different domains ......
Read more >
Spatial validation of large‐scale land surface models against ...
The LST validation data set is derived from global High-Resolution Infrared Radiometric Sounder retrievals for a 30 year period. The metrics ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found