Skip to content

Commit 6701370

Browse files
authored
Merge pull request #43 from braintrustdata/ark/dev
2 parents f6ec2fe + f22f353 commit 6701370

4 files changed

Lines changed: 15 additions & 11 deletions

File tree

build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ plugins {
33
id 'maven-publish'
44
id 'signing'
55
id 'com.diffplug.spotless' version '6.25.0'
6-
id 'io.freefair.lombok' version '9.0.0-rc2'
6+
id 'io.freefair.lombok' version '9.2.0'
77
id 'com.vanniktech.maven.publish' version '0.28.0'
88
id 'idea'
99
id 'eclipse'
@@ -42,7 +42,7 @@ repositories {
4242
}
4343

4444
ext {
45-
otelVersion = '1.54.1'
45+
otelVersion = '1.59.0'
4646
jacksonVersion = '2.16.1'
4747
junitVersion = '5.11.4'
4848
slf4jVersion = '2.0.17'
@@ -56,7 +56,7 @@ dependencies {
5656
api "io.opentelemetry:opentelemetry-sdk-logs:${otelVersion}"
5757
implementation "io.opentelemetry:opentelemetry-exporter-otlp:${otelVersion}"
5858
implementation "io.opentelemetry:opentelemetry-exporter-logging:${otelVersion}"
59-
implementation "io.opentelemetry:opentelemetry-semconv:1.30.1-alpha"
59+
implementation "io.opentelemetry.semconv:opentelemetry-semconv:1.39.0"
6060

6161
implementation "com.fasterxml.jackson.core:jackson-databind:${jacksonVersion}"
6262
implementation "com.fasterxml.jackson.datatype:jackson-datatype-jsr310:${jacksonVersion}"
@@ -78,7 +78,7 @@ dependencies {
7878
// OAI instrumentation
7979
compileOnly 'com.openai:openai-java:2.8.1'
8080
testImplementation 'com.openai:openai-java:2.8.1'
81-
implementation "io.opentelemetry.instrumentation:opentelemetry-openai-java-1.1:2.19.0-alpha"
81+
implementation "io.opentelemetry.instrumentation:opentelemetry-openai-java-1.1:2.25.0-alpha"
8282

8383
// Anthropic Instrumentation
8484
compileOnly "com.anthropic:anthropic-java:2.8.1"

src/main/java/dev/braintrust/trace/BraintrustTracing.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import io.opentelemetry.sdk.trace.SdkTracerProvider;
2020
import io.opentelemetry.sdk.trace.SdkTracerProviderBuilder;
2121
import io.opentelemetry.sdk.trace.export.BatchSpanProcessor;
22-
import io.opentelemetry.semconv.resource.attributes.ResourceAttributes;
22+
import io.opentelemetry.semconv.ServiceAttributes;
2323
import java.time.Duration;
2424
import java.util.Properties;
2525
import java.util.concurrent.TimeUnit;
@@ -103,8 +103,8 @@ public static void enable(
103103
// Create resource first so BraintrustSpanProcessor can access service.name
104104
var resourceBuilder =
105105
Resource.getDefault().toBuilder()
106-
.put(ResourceAttributes.SERVICE_NAME, OTEL_SERVICE_NAME)
107-
.put(ResourceAttributes.SERVICE_VERSION, INSTRUMENTATION_VERSION);
106+
.put(ServiceAttributes.SERVICE_NAME, OTEL_SERVICE_NAME)
107+
.put(ServiceAttributes.SERVICE_VERSION, INSTRUMENTATION_VERSION);
108108
var resource = resourceBuilder.build();
109109

110110
// spans

src/test/java/dev/braintrust/instrumentation/anthropic/BraintrustAnthropicTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ void testWrapAnthropic() {
6161

6262
// Verify standard GenAI attributes
6363
assertEquals(
64-
"anthropic", span.getAttributes().get(AttributeKey.stringKey("gen_ai.system")));
64+
"anthropic",
65+
span.getAttributes().get(AttributeKey.stringKey("gen_ai.provider.name")));
6566
assertEquals(
6667
"claude-3-5-haiku-20241022",
6768
span.getAttributes().get(AttributeKey.stringKey("gen_ai.request.model")));
@@ -155,7 +156,8 @@ void testWrapAnthropicStreaming() {
155156

156157
// Verify standard GenAI attributes
157158
assertEquals(
158-
"anthropic", span.getAttributes().get(AttributeKey.stringKey("gen_ai.system")));
159+
"anthropic",
160+
span.getAttributes().get(AttributeKey.stringKey("gen_ai.provider.name")));
159161
assertEquals(
160162
"claude-3-5-haiku-20241022",
161163
span.getAttributes().get(AttributeKey.stringKey("gen_ai.request.model")));

src/test/java/dev/braintrust/instrumentation/openai/BraintrustOpenAITest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ void testWrapOpenAi() {
6464
assertEquals("Chat Completion", span.getName());
6565

6666
// Verify essential span attributes
67-
assertEquals("openai", span.getAttributes().get(AttributeKey.stringKey("gen_ai.system")));
67+
assertEquals(
68+
"openai", span.getAttributes().get(AttributeKey.stringKey("gen_ai.provider.name")));
6869
assertEquals(
6970
"gpt-4o-mini",
7071
span.getAttributes().get(AttributeKey.stringKey("gen_ai.request.model")));
@@ -152,7 +153,8 @@ void testWrapOpenAiStreaming() {
152153
var span = spans.get(0);
153154

154155
assertEquals("Chat Completion", span.getName());
155-
assertEquals("openai", span.getAttributes().get(AttributeKey.stringKey("gen_ai.system")));
156+
assertEquals(
157+
"openai", span.getAttributes().get(AttributeKey.stringKey("gen_ai.provider.name")));
156158
assertNotNull(
157159
span.getAttributes()
158160
.get(AttributeKey.doubleKey("braintrust.metrics.time_to_first_token")));

0 commit comments

Comments
 (0)