Skip to content

Commit c1e8801

Browse files
committed
Merge branch 'main' of github.com:open-telemetry/opentelemetry-java-instrumentation into jmx-metric-lowercase-attribute
2 parents 2b297e4 + 67b014f commit c1e8801

File tree

66 files changed

+1596
-57
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

66 files changed

+1596
-57
lines changed

.github/scripts/check-latest-dep-test-overrides.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# all missing version coverage should be documented in supported-libraries.md
44

55
if grep -r --include build.gradle.kts latestDepTestLibrary instrumentation \
6-
| grep -v :+\" \
6+
| grep -v -e :+\" -e :latest.release\" \
77
| grep -v "// see .* module" \
88
| grep -v "// see test suite below" \
99
| grep -v "// no longer applicable" \

benchmark-overhead/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ repositories {
1616
}
1717

1818
dependencies {
19-
implementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
19+
implementation(enforcedPlatform("org.junit:junit-bom:5.12.0"))
2020

2121
testImplementation("org.testcontainers:testcontainers:1.20.5")
2222
testImplementation("org.testcontainers:postgresql:1.20.5")
@@ -25,7 +25,7 @@ dependencies {
2525
testImplementation("com.squareup.okhttp3:okhttp:4.12.0")
2626
testImplementation("org.jooq:joox:2.0.1")
2727
testImplementation("com.jayway.jsonpath:json-path:2.9.0")
28-
testImplementation("org.slf4j:slf4j-simple:2.0.16")
28+
testImplementation("org.slf4j:slf4j-simple:2.0.17")
2929

3030
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
3131
}
Binary file not shown.

benchmark-overhead/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

benchmark-overhead/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

conventions/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ dependencies {
7171
implementation("net.ltgt.gradle:gradle-nullaway-plugin:2.2.0")
7272
implementation("me.champeau.gradle:japicmp-gradle-plugin:0.4.6")
7373

74-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
74+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.0"))
7575
testImplementation("org.junit.jupiter:junit-jupiter-api")
7676
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
7777
testImplementation("org.assertj:assertj-core:3.27.3")

conventions/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,9 +356,10 @@ tasks.withType<Test>().configureEach {
356356
val trustStore = project(":testing-common").file("src/misc/testing-keystore.p12")
357357
// Work around payara not working when this is set for some reason.
358358
// Don't set for:
359+
// - aws-sdk as we have tests that interact with AWS and need normal trustStore
359360
// - camel as we have tests that interact with AWS and need normal trustStore
360361
// - vaadin as tests need to be able to download nodejs when not cached in ~/.vaadin/
361-
if (project.name != "jaxrs-2.0-payara-testing" && !project.path.contains("vaadin") && project.description != "camel-2-20") {
362+
if (project.name != "jaxrs-2.0-payara-testing" && !project.path.contains("vaadin") && project.description != "camel-2-20" && !project.path.contains("aws-sdk")) {
362363
jvmArgumentProviders.add(KeystoreArgumentsProvider(trustStore))
363364
}
364365

dependencyManagement/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ val byteBuddyVersion = "1.17.1"
4343
val asmVersion = "9.7.1"
4444
val jmhVersion = "1.37"
4545
val mockitoVersion = "4.11.0"
46-
val slf4jVersion = "2.0.16"
46+
val slf4jVersion = "2.0.17"
4747
val semConvVersion = "1.30.0"
4848
val semConvAlphaVersion = semConvVersion.replaceFirst("(-rc.*)?$".toRegex(), "-alpha$1")
4949

@@ -81,7 +81,7 @@ val CORE_DEPENDENCIES = listOf(
8181
// There are dependencies included here that appear to have no usages, but are maintained at
8282
// this top level to help consistently satisfy large numbers of transitive dependencies.
8383
val DEPENDENCIES = listOf(
84-
"org.junit.jupiter:junit-jupiter-api:5.11.4",
84+
"org.junit.jupiter:junit-jupiter-api:5.12.0",
8585
"org.spockframework:spock-core:2.4-M5-groovy-4.0",
8686
"org.spockframework:spock-junit4:2.4-M5-groovy-4.0",
8787

examples/distro/build.gradle

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ subprojects {
3333
opentelemetryJavaagent : "2.14.0-SNAPSHOT",
3434
opentelemetryJavaagentAlpha: "2.14.0-alpha-SNAPSHOT",
3535

36-
autoservice : "1.1.1",
37-
junit : "5.11.4"
36+
autoservice : "1.1.1"
3837
]
3938

4039
deps = [
@@ -69,9 +68,11 @@ subprojects {
6968
implementation(platform("io.opentelemetry.instrumentation:opentelemetry-instrumentation-bom-alpha:${versions.opentelemetryJavaagentAlpha}"))
7069

7170
testImplementation("org.mockito:mockito-core:5.15.2")
72-
testImplementation(enforcedPlatform("org.junit:junit-bom:${versions.junit}"))
73-
testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
74-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
71+
72+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.0"))
73+
testImplementation("org.junit.jupiter:junit-jupiter-api")
74+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
75+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
7576
}
7677

7778
tasks {
122 Bytes
Binary file not shown.

examples/distro/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

examples/distro/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

examples/distro/smoke-tests/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ dependencies {
1010
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")
1111
testImplementation("io.opentelemetry:opentelemetry-api")
1212

13-
testImplementation("ch.qos.logback:logback-classic:1.5.16")
13+
testImplementation("ch.qos.logback:logback-classic:1.5.17")
1414
}
1515

1616
tasks.test {

examples/extension/build.gradle

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ ext {
2727

2828
// these lines are managed by .github/scripts/update-version.sh
2929
opentelemetryJavaagent : "2.14.0-SNAPSHOT",
30-
opentelemetryJavaagentAlpha: "2.14.0-alpha-SNAPSHOT",
31-
32-
junit : "5.11.4"
30+
opentelemetryJavaagentAlpha: "2.14.0-alpha-SNAPSHOT"
3331
]
3432

3533
deps = [
@@ -106,9 +104,12 @@ dependencies {
106104
testImplementation("io.opentelemetry:opentelemetry-api")
107105
testImplementation("io.opentelemetry.proto:opentelemetry-proto:1.5.0-alpha")
108106

109-
testImplementation("org.junit.jupiter:junit-jupiter-api:${versions.junit}")
110-
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:${versions.junit}")
111-
testRuntimeOnly("ch.qos.logback:logback-classic:1.5.16")
107+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.0"))
108+
testImplementation("org.junit.jupiter:junit-jupiter-api")
109+
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
110+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
111+
112+
testRuntimeOnly("ch.qos.logback:logback-classic:1.5.17")
112113

113114
//Otel Java instrumentation that we use and extend during integration tests
114115
otel("io.opentelemetry.javaagent:opentelemetry-javaagent:${versions.opentelemetryJavaagent}")
Binary file not shown.

examples/extension/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

examples/extension/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

gradle-plugins/build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ dependencies {
4444

4545
testImplementation("org.assertj:assertj-core:3.27.3")
4646

47-
testImplementation(enforcedPlatform("org.junit:junit-bom:5.11.4"))
47+
testImplementation(enforcedPlatform("org.junit:junit-bom:5.12.0"))
4848
testImplementation("org.junit.jupiter:junit-jupiter-api")
49-
testImplementation("org.junit.jupiter:junit-jupiter-params")
5049
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
50+
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
5151
}
5252

5353
tasks {
122 Bytes
Binary file not shown.

gradle-plugins/gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradle-plugins/gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.

gradle/wrapper/gradle-wrapper.jar

122 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=8d97a97984f6cbd2b85fe4c60a743440a347544bf18818048e611f5288d46c94
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12.1-bin.zip
3+
distributionSha256Sum=20f1b1176237254a6fc204d8434196fa11a4cfb387567519c61556e8710aed78
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ fi
205205
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
206206

207207
# Collect all arguments for the java command:
208-
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
208+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
209209
# and any embedded shellness will be escaped.
210210
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
211211
# treated as '${Hostname}' itself on the command line.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
* Copyright The OpenTelemetry Authors
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
package io.opentelemetry.instrumentation.api.incubator.semconv.genai;
7+
8+
import static io.opentelemetry.api.common.AttributeKey.doubleKey;
9+
import static io.opentelemetry.api.common.AttributeKey.longKey;
10+
import static io.opentelemetry.api.common.AttributeKey.stringArrayKey;
11+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
12+
import static io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil.internalSet;
13+
14+
import io.opentelemetry.api.common.AttributeKey;
15+
import io.opentelemetry.api.common.AttributesBuilder;
16+
import io.opentelemetry.context.Context;
17+
import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor;
18+
import java.util.List;
19+
import javax.annotation.Nullable;
20+
21+
/**
22+
* Extractor of <a href="https://opentelemetry.io/docs/specs/semconv/gen-ai/gen-ai-spans/">GenAI
23+
* attributes</a>.
24+
*
25+
* <p>This class delegates to a type-specific {@link GenAiAttributesGetter} for individual attribute
26+
* extraction from request/response objects.
27+
*/
28+
public final class GenAiAttributesExtractor<REQUEST, RESPONSE>
29+
implements AttributesExtractor<REQUEST, RESPONSE> {
30+
31+
// copied from GenAiIncubatingAttributes
32+
private static final AttributeKey<String> GEN_AI_OPERATION_NAME =
33+
stringKey("gen_ai.operation.name");
34+
private static final AttributeKey<List<String>> GEN_AI_REQUEST_ENCODING_FORMATS =
35+
stringArrayKey("gen_ai.request.encoding_formats");
36+
private static final AttributeKey<Double> GEN_AI_REQUEST_FREQUENCY_PENALTY =
37+
doubleKey("gen_ai.request.frequency_penalty");
38+
private static final AttributeKey<Long> GEN_AI_REQUEST_MAX_TOKENS =
39+
longKey("gen_ai.request.max_tokens");
40+
private static final AttributeKey<String> GEN_AI_REQUEST_MODEL =
41+
stringKey("gen_ai.request.model");
42+
private static final AttributeKey<Double> GEN_AI_REQUEST_PRESENCE_PENALTY =
43+
doubleKey("gen_ai.request.presence_penalty");
44+
private static final AttributeKey<Long> GEN_AI_REQUEST_SEED = longKey("gen_ai.request.seed");
45+
private static final AttributeKey<List<String>> GEN_AI_REQUEST_STOP_SEQUENCES =
46+
stringArrayKey("gen_ai.request.stop_sequences");
47+
private static final AttributeKey<Double> GEN_AI_REQUEST_TEMPERATURE =
48+
doubleKey("gen_ai.request.temperature");
49+
private static final AttributeKey<Double> GEN_AI_REQUEST_TOP_K =
50+
doubleKey("gen_ai.request.top_k");
51+
private static final AttributeKey<Double> GEN_AI_REQUEST_TOP_P =
52+
doubleKey("gen_ai.request.top_p");
53+
private static final AttributeKey<List<String>> GEN_AI_RESPONSE_FINISH_REASONS =
54+
stringArrayKey("gen_ai.response.finish_reasons");
55+
private static final AttributeKey<String> GEN_AI_RESPONSE_ID = stringKey("gen_ai.response.id");
56+
private static final AttributeKey<String> GEN_AI_RESPONSE_MODEL =
57+
stringKey("gen_ai.response.model");
58+
private static final AttributeKey<String> GEN_AI_SYSTEM = stringKey("gen_ai.system");
59+
private static final AttributeKey<Long> GEN_AI_USAGE_INPUT_TOKENS =
60+
longKey("gen_ai.usage.input_tokens");
61+
private static final AttributeKey<Long> GEN_AI_USAGE_OUTPUT_TOKENS =
62+
longKey("gen_ai.usage.output_tokens");
63+
64+
/** Creates the GenAI attributes extractor. */
65+
public static <REQUEST, RESPONSE> AttributesExtractor<REQUEST, RESPONSE> create(
66+
GenAiAttributesGetter<REQUEST, RESPONSE> attributesGetter) {
67+
return new GenAiAttributesExtractor<>(attributesGetter);
68+
}
69+
70+
private final GenAiAttributesGetter<REQUEST, RESPONSE> getter;
71+
72+
private GenAiAttributesExtractor(GenAiAttributesGetter<REQUEST, RESPONSE> getter) {
73+
this.getter = getter;
74+
}
75+
76+
@Override
77+
public void onStart(AttributesBuilder attributes, Context parentContext, REQUEST request) {
78+
internalSet(attributes, GEN_AI_OPERATION_NAME, getter.getOperationName(request));
79+
internalSet(attributes, GEN_AI_SYSTEM, getter.getSystem(request));
80+
internalSet(attributes, GEN_AI_REQUEST_MODEL, getter.getRequestModel(request));
81+
internalSet(attributes, GEN_AI_REQUEST_SEED, getter.getRequestSeed(request));
82+
internalSet(
83+
attributes, GEN_AI_REQUEST_ENCODING_FORMATS, getter.getRequestEncodingFormats(request));
84+
internalSet(
85+
attributes, GEN_AI_REQUEST_FREQUENCY_PENALTY, getter.getRequestFrequencyPenalty(request));
86+
internalSet(attributes, GEN_AI_REQUEST_MAX_TOKENS, getter.getRequestMaxTokens(request));
87+
internalSet(
88+
attributes, GEN_AI_REQUEST_PRESENCE_PENALTY, getter.getRequestPresencePenalty(request));
89+
internalSet(attributes, GEN_AI_REQUEST_STOP_SEQUENCES, getter.getRequestStopSequences(request));
90+
internalSet(attributes, GEN_AI_REQUEST_TEMPERATURE, getter.getRequestTemperature(request));
91+
internalSet(attributes, GEN_AI_REQUEST_TOP_K, getter.getRequestTopK(request));
92+
internalSet(attributes, GEN_AI_REQUEST_TOP_P, getter.getRequestTopP(request));
93+
}
94+
95+
@Override
96+
public void onEnd(
97+
AttributesBuilder attributes,
98+
Context context,
99+
REQUEST request,
100+
@Nullable RESPONSE response,
101+
@Nullable Throwable error) {
102+
internalSet(
103+
attributes,
104+
GEN_AI_RESPONSE_FINISH_REASONS,
105+
getter.getResponseFinishReasons(request, response));
106+
internalSet(attributes, GEN_AI_RESPONSE_ID, getter.getResponseId(request, response));
107+
internalSet(attributes, GEN_AI_RESPONSE_MODEL, getter.getResponseModel(request, response));
108+
internalSet(
109+
attributes, GEN_AI_USAGE_INPUT_TOKENS, getter.getUsageInputTokens(request, response));
110+
internalSet(
111+
attributes, GEN_AI_USAGE_OUTPUT_TOKENS, getter.getUsageOutputTokens(request, response));
112+
}
113+
}

0 commit comments

Comments
 (0)