opentelemetry-java-instrume.../instrumentation/vibur-dbcp-11.0/library
Mateusz Rzeszutek 4fd52c5a7c
Encode version in library instrumentations' package names (#7764)
Another part of #932

In this PR I changed all the library instrumentation packages -- these
are breaking changes, so I figured the earlier we do this the less
painful it'll be to the users. I know that at least some of them are
actively used, so we'll need to spell this out in the release notes.

---------

Co-authored-by: Trask Stalnaker <trask.stalnaker@gmail.com>
2023-02-14 23:25:59 +00:00
..
src Encode version in library instrumentations' package names (#7764) 2023-02-14 23:25:59 +00:00
README.md Introduce markdown lint check (#7175) 2022-11-16 20:48:42 -08:00
build.gradle.kts Implement Vibur DBCP connection pool metrics (#6092) 2022-05-26 11:26:02 +03:00

README.md

Library Instrumentation for Vibur DBCP version 11.0 and higher

Provides OpenTelemetry instrumentation for Vibur DBCP.

Quickstart

Add these dependencies to your project

Replace OPENTELEMETRY_VERSION with the latest release.

For Maven, add to your pom.xml dependencies:

<dependencies>
  <dependency>
    <groupId>io.opentelemetry.instrumentation</groupId>
    <artifactId>opentelemetry-vibur-dbcp-11.0</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-vibur-dbcp-11.0:OPENTELEMETRY_VERSION")

Usage

The instrumentation library allows registering ViburDBCPDataSource instances for collecting OpenTelemetry-based metrics.

ViburTelemetry viburTelemetry;

void configure(OpenTelemetry openTelemetry, ViburDBCPDataSource viburDataSource) {
  viburTelemetry = ViburTelemetry.create(openTelemetry);
  viburTelemetry.registerMetrics(viburDataSource);
}

void destroy(ViburDBCPDataSource viburDataSource) {
  viburTelemetry.unregisterMetrics(viburDataSource);
}