opentelemetry-java-instrume.../instrumentation/c3p0-0.9/library
Trask Stalnaker 71b3e3e027
Library doc cleanup (#6948)
Related to #6947, but just cleans up the library module doc that already
existed (mostly for uniformity). Does not introduce any new doc.
2022-10-24 10:26:21 -07:00
..
src Use metrics batch API in connection pool instrumentations (#6231) 2022-07-05 13:47:15 +02:00
README.md Library doc cleanup (#6948) 2022-10-24 10:26:21 -07:00
build.gradle.kts Implement C3P0 connection pool metrics (#6174) 2022-06-20 14:21:54 +03:00

README.md

Library Instrumentation for C3P0 version 0.9 and higher

Provides OpenTelemetry instrumentation for C3P0.

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-c3p0-0.9</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-c3p0-0.9:OPENTELEMETRY_VERSION")

Usage

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

C3p0Telemetry c3p0Telemetry;

void configure(OpenTelemetry openTelemetry, PooledDataSource dataSource) {
  c3p0Telemetry = C3p0Telemetry.create(openTelemetry);
  c3p0Telemetry.registerMetrics(dataSource);
}

void destroy(PooledDataSource dataSource) {
  c3p0Telemetry.unregisterMetrics(dataSource);
}