Mateusz Rzeszutek 65ee9510f5 Rename the `instrumentation-api-semconv` module into `instrumentation-api-incubator` (#9985) hai 1 ano
..
src 65ee9510f5 Rename the `instrumentation-api-semconv` module into `instrumentation-api-incubator` (#9985) hai 1 ano
README.md 2d7395c44b Introduce markdown lint check (#7175) %!s(int64=2) %!d(string=hai) anos
build.gradle.kts dd5e30defd Implement HikariCP library instrumentation (#6023) %!s(int64=2) %!d(string=hai) anos

README.md

Library Instrumentation for HikariCP version 3.0 and higher

Provides OpenTelemetry instrumentation for HikariCP.

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-hikaricp-3.0</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-hikaricp-3.0:OPENTELEMETRY_VERSION")

Usage

The instrumentation library provides a MetricsTrackerFactory implementation that can be added to an instance of the HikariConfig (or HikariDataSource) to provide OpenTelemetry-based metrics.

void configure(OpenTelemetry openTelemetry, HikariConfig connectionPoolConfig) {
  HikariTelemetry telemetry = HikariTelemetry.create(openTelemetry);
  connectionPoolConfig.setMetricsTrackerFactory(telemetry.createMetricsTrackerFactory());
}