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

Micrometer metrics #1173

Merged
merged 1 commit into from
Mar 9, 2022
Merged

Micrometer metrics #1173

merged 1 commit into from
Mar 9, 2022

Conversation

injectives
Copy link
Contributor

Cherry-pick: #1137

* [WIP] Micrometer metrics instrumentation

This is a work-in-progress attempt at instrumenting the driver with Micrometer as an optional alternative metrics implementation to the existing internal one.

* Bring it to life.

* Update Micrometer metrics

This update includes general improvements, refactorings and tests.

* Make MetricsAdapter a supported, public api.

- Set scope of micrometer to provided
- Rename MetricsProvider to MetricsAdapter (it does not provide metrics, the driver does. It adapts the drivers metrics to something external)
- Make it a public interface
- Remove dependencies to other internal interfaces and classes (such as BoltServerAddress and the pool itself via ServerAddress and intsuppliers)
- Reduce visibility of internal classes as much as possible
- Make sure that adapters are not serialized
- Apply the clock to the internal adapter (an oversight from the previous iteration)

* Saving a file before commiting seems to be relevant.

* Not messing up the file while saven even more so.

* Make interfaces internal again, provide an enum to select the provider, use global registry by default.

This change keeps the existing serialization feature of config correct.
It will work for everyone just using micrometer as is with the global registry.
if there is a need to select the registriy, we can work on that later.

* Move micrometer-core optional tag to dependency declaration

* Update Config javadoc and remove imports of internal metrics classes

* Update withMetricsEnabled(boolean) implementation

* Enable ConfigBuilder.withMetricsAdapter documentation

* Update driver/src/main/java/org/neo4j/driver/ConnectionPoolMetrics.java

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>

* Update ConnectionPoolMetrics documentation

* Update MetricsAdapter documentation

* Update formatting in ConfigTest

* Update wording

* Updated wording

* Formatting

* Update driver/src/main/java/org/neo4j/driver/internal/metrics/DevNullMetricsListener.java

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>

* Update driver/src/main/java/org/neo4j/driver/internal/metrics/MicrometerConnectionPoolMetrics.java

Co-authored-by: Gerrit Meier <meistermeier@gmail.com>

* Fix compilation error

* Update failing test

* Fix GetConnectionPoolMetrics access

* Delete redundant counters based on review feedback

Co-authored-by: Tommy Ludwig <8924140+shakuzen@users.noreply.github.com>
Co-authored-by: Gerrit Meier <meistermeier@gmail.com>
Co-authored-by: Michael Simons <michael.simons@neo4j.com>
@injectives injectives merged commit 05eb4a3 into neo4j:4.4 Mar 9, 2022
@injectives injectives deleted the feature/micrometer branch March 9, 2022 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants