Skip to content

Commit

Permalink
Enabling tracing for GenAI inference APIs (Azure#43284)
Browse files Browse the repository at this point in the history
* Enabling tracing for GenAI inference APIs.
  • Loading branch information
anuchandy authored Dec 17, 2024
1 parent 988f80e commit 729e015
Show file tree
Hide file tree
Showing 12 changed files with 1,890 additions and 19 deletions.
1 change: 1 addition & 0 deletions .vscode/cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@
{
"filename": "/sdk/ai/**",
"words": [
"OTEL",
"ubinary",
"UBINARY"
]
Expand Down
2 changes: 1 addition & 1 deletion sdk/ai/azure-ai-inference/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo" : "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath" : "java",
"TagPrefix" : "java/ai/azure-ai-inference",
"Tag" : "java/ai/azure-ai-inference_5c740d7f95"
"Tag" : "java/ai/azure-ai-inference_47913ffcfa"
}
5 changes: 5 additions & 0 deletions sdk/ai/azure-ai-inference/checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,9 @@
<suppress files="com.azure.ai.inference.ChatCompletionsAsyncClient.java" checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" />
<suppress files="com.azure.ai.inference.ChatCompletionsClient.java" checks="com.azure.tools.checkstyle.checks.ServiceClientCheck" />
<suppress files="com.azure.ai.inference.implementation.InferenceServerSentEvents.java" checks="com.azure.tools.checkstyle.checks.ThrowFromClientLoggerCheck" />

<suppress checks="IllegalImport" files="com.azure.ai.inference.ChatCompletionClientTracerTest.java" />
<suppress checks="IllegalImport" files="com.azure.ai.inference.ChatCompletionsSyncClientTest.java" />
<suppress checks="IllegalImport" files="com.azure.ai.inference.usage.TraceChatCompletionsToolCallSample.java" />
<suppress checks="IllegalImport" files="com.azure.ai.inference.usage.TraceStreamingChatCompletionsToolCallSample.java" />
</suppressions>
47 changes: 47 additions & 0 deletions sdk/ai/azure-ai-inference/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@
<checkstyle.suppressionsLocation>checkstyle-suppressions.xml</checkstyle.suppressionsLocation>
<spotbugs.skip>false</spotbugs.skip>
<spotbugs.excludeFilterFile>spotbugs-exclude.xml</spotbugs.excludeFilterFile>
<javaModulesSurefireArgLine>
--add-opens com.azure.ai.inference/com.azure.ai.inference=ALL-UNNAMED

--add-exports com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
--add-opens com.azure.core/com.azure.core.implementation.util=ALL-UNNAMED
--add-reads com.azure.ai.inference=com.azure.http.netty

--add-reads com.azure.ai.inference=com.azure.core.tracing.opentelemetry
</javaModulesSurefireArgLine>
</properties>
<dependencies>
<dependency>
Expand Down Expand Up @@ -85,5 +94,43 @@
<version>1.0.0</version> <!-- {x-version-update;com.knuddels:jtokkit;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-tracing-opentelemetry</artifactId>
<version>1.0.0-beta.52</version> <!-- {x-version-update;com.azure:azure-core-tracing-opentelemetry;dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-sdk-extension-autoconfigure</artifactId>
<version>1.43.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-sdk-extension-autoconfigure;external_dependency} -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-exporter-otlp</artifactId>
<version>1.43.0</version> <!-- {x-version-update;io.opentelemetry:opentelemetry-exporter-otlp;external_dependency} -->
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>3.5.0</version> <!-- {x-version-update;org.apache.maven.plugins:maven-enforcer-plugin;external_dependency} -->
<configuration>
<rules>
<bannedDependencies>
<includes>
<!-- opentelemetry-exporter-otlp is used in test scope for tracing samples. -->
<include>io.opentelemetry:opentelemetry-exporter-otlp:[1.43.0]</include> <!-- {x-include-update;io.opentelemetry:opentelemetry-exporter-otlp;external_dependency} -->
</includes>
</bannedDependencies>
</rules>
</configuration>
</plugin>
</plugins>
</build>
</project>
Loading

0 comments on commit 729e015

Please sign in to comment.