Java

Java Java的OpenTelemetry语言特定实现。

This is the OpenTelemetry Java documentation. OpenTelemetry is an observability framework – an API, SDK, and tools that are designed to aid in the generation and collection of application telemetry data such as metrics, logs, and traces. This documentation is designed to help you understand how to get started using OpenTelemetry Java.

Status and Releases

The current status of the major functional components for OpenTelemetry Java is as follows:

Traces Metrics Logs
Stable Stable Stable

For releases, including the latest release, see Releases.

仓库

OpenTelemetry Java包括以下仓库:

  • opentelemetry-java: 包含手动器具的组件,包括API、SDK和扩展功能,以及OpenTracing的适配器。
  • opentelemetry-java-docs: 手动器具示例。
  • opentelemetry-java-instrumentation: 基于opentelemetry-java构建的Java代理JAR,可附加到任何Java 8+应用程序,并动态注入字节码,从多个热门库和框架中捕获遥测数据。
  • opentelemetry-java-contrib: 提供一些有用的库和独立的基于OpenTelemetry的实用工具,不适用于OpenTelemetry Java或Java Instrumentation项目的特定领域。例如,JMX度量收集。

组件

请参阅组件以查看已发布组件的完整列表。

发布版本

已发布的发布版本可在maven中央仓库上找到。我们强烈建议使用我们的BOM文件来保持各组件的版本同步。

Maven

<project>
  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>io.opentelemetry</groupId>
        <artifactId>opentelemetry-bom</artifactId>
        <version>1.31.0</version>
        <type>pom</type>
        <scope>import</scope>
      </dependency>
    </dependencies>
  </dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>io.opentelemetry</groupId>
      <artifactId>opentelemetry-api</artifactId>
    </dependency>
  </dependencies>
</project>

Gradle

dependencies {
  implementation(platform("io.opentelemetry:opentelemetry-bom:1.31.0"))
  implementation("io.opentelemetry:opentelemetry-api")
}

入门指南

在不到5分钟内为您的应用程序获取遥测!

自动仪表化

手动仪表化

OpenTelemetry Java 的手动仪表化

使用仪表库

导出器

资源

API 参考

示例

最后修改 December 10, 2023: translate (a4350d6e)