Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15755,6 +15755,23 @@ libraries:
spans:
- span_kind: INTERNAL
attributes: []
- name: thrift-0.13
display_name: Apache Thrift
description: This instrumentation enables RPC client and RPC server spans and metrics
for Apache Thrift.
semantic_conventions:
- RPC_CLIENT_SPANS
- RPC_CLIENT_METRICS
- RPC_SERVER_SPANS
- RPC_SERVER_METRICS
library_link: https://thrift.apache.org
source_path: instrumentation/thrift-0.13
scope:
name: io.opentelemetry.thrift-0.13
has_standalone_library: true
has_javaagent: true
javaagent_target_versions:
- org.apache.thrift:libthrift:[0.13.0,)
- name: tomcat-7.0
display_name: Apache Tomcat
description: This instrumentation enables HTTP server spans and HTTP server metrics
Expand Down Expand Up @@ -16640,7 +16657,7 @@ libraries:
default: true
- name: otel.instrumentation.kafka.experimental-span-attributes
declarative_name: java.kafka.experimental_span_attributes/development
description: Enables the capture of the experimental consumer attribute `kafka.record.queue_time_ms`
description: Enables the capture of the experimental consumer attributes `kafka.record.queue_time_ms`
and `messaging.kafka.bootstrap.servers`.
type: boolean
default: false
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Library Instrumentation for Apache Thrift 0.13.0+

Provides OpenTelemetry instrumentation for [Apache Thrift](https://thrift.apache.org/).

## Quickstart

### Add the following dependencies to your project

Replace `OPENTELEMETRY_VERSION` with the [latest release](https://central.sonatype.com/artifact/io.opentelemetry.instrumentation/opentelemetry-thrift-0.13).

For Maven, add the following to your `pom.xml` dependencies:

```xml
<dependencies>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-thrift-0.13</artifactId>
<version>OPENTELEMETRY_VERSION</version>
</dependency>
</dependencies>
```

For Gradle, add the following to your dependencies:

```groovy
implementation("io.opentelemetry.instrumentation:opentelemetry-thrift-0.13:OPENTELEMETRY_VERSION")
```

### Usage

The instrumentation library provides wrappers for thrift servers and clients that provide OpenTelemetry-based spans and context propagation.

```java
// For server-side, decorate processor with a tracing wrapper.
TProcessor configureServer(OpenTelemetry openTelemetry, TProcessor processor, String serviceName) {
ThriftTelemetry thriftTelemetry = ThriftTelemetry.create(openTelemetry);
return thriftTelemetry.wrapServerProcessor(processor, serviceName);
}

// For client-side, decorate protocol and client with a tracing wrappers.
TProtocol configureClient(OpenTelemetry openTelemetry, TProtocol protocol) {
ThriftTelemetry thriftTelemetry = ThriftTelemetry.create(openTelemetry);
return thriftTelemetry.wrapClientProtocol(protocol);
}

CustomService.Iface configureClient(OpenTelemetry openTelemetry, CustomService.Client client) {
ThriftTelemetry thriftTelemetry = ThriftTelemetry.create(openTelemetry);
return thriftTelemetry.wrapClient(client, CustomService.Iface.class);
}

// For non-blocking client, decorate protocol factory and the async client with a tracing wrappers.
TProtocolFactory configureClient(OpenTelemetry openTelemetry, TProtocolFactory protocolFactory) {
ThriftTelemetry thriftTelemetry = ThriftTelemetry.create(openTelemetry);
return thriftTelemetry.wrapClientProtocolFactory(protocolFactory);
}

CustomService.AsyncIface configureClient(OpenTelemetry openTelemetry, CustomService.AsyncClient asyncClient) {
ThriftTelemetry thriftTelemetry = ThriftTelemetry.create(openTelemetry);
return thriftTelemetry.wrapAsyncClient(asyncClient, CustomService.AsyncIface.class);
}
```
Loading