-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Database reference documentation (#4574)
* Database reference documentation * Added jdbc observations section
- Loading branch information
1 parent
9a81218
commit f8e11f2
Showing
5 changed files
with
70 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
[[overview]] | ||
= Database Instrumentation | ||
|
||
Micrometer can instrument various libraries that interact with databases | ||
|
||
* <<db-datasource-observation, DataSource Observation Instrumentation>> | ||
* <<db-datasource, DataSource Metrics Instrumentation>> | ||
* <<db-jooq, jOOQ Instrumentation>> | ||
* <<db-postgres, PostgreSQL Instrumentation>> | ||
|
||
[[db-datasource-observation]] | ||
== DataSource Observation Instrumentation | ||
|
||
Through the https://github.com/jdbc-observations/datasource-micrometer[Datasource Micrometer] project you can instrument your `Datasource` to start producing https://docs.micrometer.io/micrometer/reference/observation.html[Observations] while interacting with the database. That means that depending on your Observation Handler setup you can plug in producing of metrics or distributed tracing. | ||
|
||
You can read more about Datasource Micrometer https://jdbc-observations.github.io/datasource-micrometer/docs/current/docs/html/[reference documentation] here. | ||
|
||
[[db-datasource]] | ||
== DataSource Metrics Instrumentation | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Binding instrumentation through static method | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/DatabaseTableMetricsTest.java[tags=monitor, indent=0] | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/DatabaseTableMetricsTest.java[tags=statement, indent=0] | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/DatabaseTableMetricsTest.java[tags=result, indent=0] | ||
----- | ||
|
||
[[db-jooq]] | ||
== jOOQ Instrumentation | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Setting up instrumentation | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/MetricsDSLContextTest.java[tags=setup, indent=0] | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/MetricsDSLContextTest.java[tags=result, indent=0] | ||
----- | ||
|
||
[[db-postgres]] | ||
== PostgresSQL Instrumentation | ||
|
||
[source,java,subs=+attributes] | ||
----- | ||
// Setting up instrumentation | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/PostgreSQLDatabaseMetricsIntegrationTest.java[tags=setup, indent=0] | ||
// Usage example | ||
include::{include-core-test-java}/io/micrometer/core/instrument/binder/db/PostgreSQLDatabaseMetricsIntegrationTest.java[tags=result, indent=0] | ||
----- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters