SylvainJuge 955470a63a Semconv 1.25.0 migration (#10983) 11 달 전
..
src 955470a63a Semconv 1.25.0 migration (#10983) 11 달 전
README.md 0a717edeb8 Small library doc updates (#9868) 1 년 전
build.gradle.kts fdeb032b33 Disable controller and view spans by default (#10042) 1 년 전

README.md

Library Instrumentation for Ktor versions 1.x

This package contains libraries to help instrument Ktor. Currently, only server instrumentation is supported.

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-ktor-1.0</artifactId>
    <version>OPENTELEMETRY_VERSION</version>
  </dependency>
</dependencies>

For Gradle, add to your dependencies:

implementation("io.opentelemetry.instrumentation:opentelemetry-ktor-1.0:OPENTELEMETRY_VERSION")

Usage

Initialize instrumentation by installing the KtorServerTracing feature. You must set the OpenTelemetry to use with the feature.

OpenTelemetry openTelemetry = ...

embeddedServer(Netty, 8080) {
  install(KtorServerTracing) {
    setOpenTelemetry(openTelemetry)
  }
}