Skip to content
Closed

Main #25

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
1261eda
Fix
peachisai Jan 7, 2026
75c22d1
Add spring ai 1.x plugin for LLM monitoring
peachisai Jan 28, 2026
ab8837f
fix
peachisai Feb 3, 2026
869e6bb
fix
peachisai Feb 3, 2026
4a2992d
fix
peachisai Feb 3, 2026
ff42120
fix
peachisai Feb 3, 2026
6c9ce2a
fix
peachisai Feb 4, 2026
142a456
fix
peachisai Feb 4, 2026
44e4589
fix
peachisai Feb 4, 2026
4b25e8f
fix
peachisai Feb 4, 2026
175792a
fix
peachisai Feb 5, 2026
0a57046
fix
peachisai Feb 5, 2026
346a189
fix
peachisai Feb 5, 2026
f20a8c6
fix
peachisai Feb 5, 2026
d1a6908
fix
peachisai Feb 6, 2026
58b1ca3
fix
peachisai Feb 12, 2026
31d92b3
fix
peachisai Feb 12, 2026
ac028a8
fix
peachisai Feb 14, 2026
332be22
fix
peachisai Feb 17, 2026
5f9a950
fix
peachisai Feb 18, 2026
c30b9ad
Merge branch 'Add-the-spring-ai-plugin'
peachisai Feb 18, 2026
9f98420
fix
peachisai Feb 18, 2026
be4827d
fix
peachisai Feb 18, 2026
43905d5
fix
peachisai Feb 20, 2026
cbb951f
fix
peachisai Feb 21, 2026
9149dc9
fix
peachisai Feb 21, 2026
a6eeffa
fix
peachisai Feb 21, 2026
4f97346
fix
peachisai Feb 21, 2026
f9730ba
fix
peachisai Feb 21, 2026
713da64
Merge remote-tracking branch 'origin/Add-the-spring-ai-plugin'
peachisai Feb 21, 2026
a4994a5
Revert "Begin 9.7.0 iteration, 9.6.0 is tagged for release. (#791)"
peachisai Feb 21, 2026
339afdf
fix
peachisai Feb 22, 2026
768c97d
fix
peachisai Feb 22, 2026
2fb4307
fix
peachisai Feb 22, 2026
eeba921
fix
peachisai Feb 22, 2026
7243f37
fix
peachisai Feb 22, 2026
b8e67cb
fix
peachisai Feb 23, 2026
874fe2f
fix
peachisai Feb 23, 2026
b0f481d
fix
peachisai Feb 23, 2026
ffa75f6
fix
peachisai Feb 23, 2026
4f5c8ff
fix
peachisai Feb 23, 2026
976e65c
fix
peachisai Feb 24, 2026
4adfbbb
fix
peachisai Feb 24, 2026
13baa14
fix
peachisai Feb 24, 2026
3eb47a2
fix
peachisai Feb 24, 2026
0b870f0
fix
peachisai Feb 25, 2026
947f751
fix
peachisai Feb 25, 2026
672e93c
Merge branch 'Add-the-spring-ai-plugin'
peachisai Feb 25, 2026
32d044e
fix
peachisai Feb 25, 2026
079a389
fix
peachisai Feb 25, 2026
91cfbe5
fix
peachisai Feb 25, 2026
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
1 change: 1 addition & 0 deletions .github/workflows/plugins-jdk17-test.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ jobs:
- grizzly-2.3.x-4.x-workthreadpool-scenario
- jetty-11.x-scenario
- jetty-10.x-scenario
- spring-ai-1.x-scenario
steps:
- uses: actions/checkout@v2
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,4 +265,34 @@ public class ComponentsDefine {

public static final OfficialComponent DMDB_JDBC_DRIVER = new OfficialComponent(163, "Dmdb-jdbc-driver");

public static final OfficialComponent SPRING_AI_UNKNOWN = new OfficialComponent(164, "spring-ai-unknown");

public static final OfficialComponent SPRING_AI_ANTHROPIC = new OfficialComponent(165, "spring-ai-anthropic");

public static final OfficialComponent SPRING_AI_BEDROCK = new OfficialComponent(166, "spring-ai-aws-bedrock");

public static final OfficialComponent SPRING_AI_AZURE_OPENAI = new OfficialComponent(167, "spring-ai-azure-openai");

public static final OfficialComponent SPRING_AI_COHERE = new OfficialComponent(168, "spring-ai-cohere");

public static final OfficialComponent SPRING_AI_DEEPSEEK = new OfficialComponent(169, "spring-ai-deepseek");

public static final OfficialComponent SPRING_AI_GOOGLE_GENAI = new OfficialComponent(170, "spring-ai-gcp-genai");

public static final OfficialComponent SPRING_AI_VERTEXAI = new OfficialComponent(171, "spring-ai-gcp-vertex-ai");

public static final OfficialComponent SPRING_AI_MISTRAL_AI = new OfficialComponent(172, "spring-ai-mistral-ai");

public static final OfficialComponent SPRING_AI_OPENAI = new OfficialComponent(173, "spring-ai-openai");

public static final OfficialComponent SPRING_AI_HUGGINGFACE = new OfficialComponent(174, "spring-ai-huggingface");

public static final OfficialComponent SPRING_AI_MINIMAX = new OfficialComponent(175, "spring-ai-minimax");

public static final OfficialComponent SPRING_AI_OLLAMA = new OfficialComponent(176, "spring-ai-ollama");

public static final OfficialComponent SPRING_AI_ZHIPU_AI = new OfficialComponent(177, "spring-ai-zhipu-ai");

public static final OfficialComponent SPRING_AI = new OfficialComponent(178, "spring-ai");

}
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,96 @@ public static final class HTTP {
*/
public static final StringTag THREAD_CARRIER = new StringTag(24, "thread.carrier");

/**
* GEN_AI_OPERATION_NAME represents the name of the operation being performed
*/
public static final StringTag GEN_AI_OPERATION_NAME = new StringTag(25, "gen_ai.operation.name");

/**
* GEN_AI_PROVIDER_NAME represents the Generative AI provider as identified by the client or server instrumentation.
*/
public static final StringTag GEN_AI_PROVIDER_NAME = new StringTag(26, "gen_ai.provider.name");

/**
* GEN_AI_REQUEST_MODEL represents the name of the GenAI model a request is being made to.
*/
public static final StringTag GEN_AI_REQUEST_MODEL = new StringTag(27, "gen_ai.request.model");

/**
* GEN_AI_TOP_K represents the top_k sampling setting for the GenAI request.
*/
public static final StringTag GEN_AI_TOP_K = new StringTag(28, "gen_ai.request.top_k");

/**
* GEN_AI_TOP_P represents the top_p sampling setting for the GenAI request.
*/
public static final StringTag GEN_AI_TOP_P = new StringTag(29, "gen_ai.request.top_p");

/**
* GEN_AI_TEMPERATURE represents the temperature setting for the GenAI request.
*/
public static final StringTag GEN_AI_TEMPERATURE = new StringTag(30, "gen_ai.request.temperature");

/**
* GEN_AI_TOOL_NAME represents the name of the tool utilized by the agent.
*/
public static final StringTag GEN_AI_TOOL_NAME = new StringTag(31, "gen_ai.tool.name");

/**
* GEN_AI_TOOL_CALL_ARGUMENTS represents the parameters passed to the tool call.
*/
public static final StringTag GEN_AI_TOOL_CALL_ARGUMENTS = new StringTag(32, "gen_ai.tool.call.arguments");

/**
* GEN_AI_TOOL_CALL_RESULT represents the result returned by the tool call (if any and if execution was successful).
*/
public static final StringTag GEN_AI_TOOL_CALL_RESULT = new StringTag(33, "gen_ai.tool.call.result");

/**
* GEN_AI_RESPONSE_MODEL represents the name of the model that generated the response.
*/
public static final StringTag GEN_AI_RESPONSE_MODEL = new StringTag(34, "gen_ai.response.model");

/**
* GEN_AI_RESPONSE_ID represents the unique identifier for the completion.
*/
public static final StringTag GEN_AI_RESPONSE_ID = new StringTag(35, "gen_ai.response.id");

/**
* GEN_AI_USAGE_INPUT_TOKENS represents the number of tokens used in the GenAI input (prompt).
*/
public static final StringTag GEN_AI_USAGE_INPUT_TOKENS = new StringTag(36, "gen_ai.usage.input_tokens");

/**
* GEN_AI_USAGE_OUTPUT_TOKENS represents the number of tokens used in the GenAI response (completion).
*/
public static final StringTag GEN_AI_USAGE_OUTPUT_TOKENS = new StringTag(37, "gen_ai.usage.output_tokens");

/**
* GEN_AI_USAGE_TOTAL_TOKENS represents the total number of tokens used in the GenAI exchange.
*/
public static final StringTag GEN_AI_CLIENT_TOKEN_USAGE = new StringTag(38, "gen_ai.client.token.usage");

/**
* GEN_AI_RESPONSE_FINISH_REASONS represents the array of reasons the model stopped generating tokens.
*/
public static final StringTag GEN_AI_RESPONSE_FINISH_REASONS = new StringTag(39, "gen_ai.response.finish_reasons");

/**
* GEN_AI_STREAM_TTFR represents the time to first response (TTFR) for streaming operations.
*/
public static final StringTag GEN_AI_STREAM_TTFR = new StringTag(40, "gen_ai.stream.ttfr");

/**
* GEN_AI_INPUT_MESSAGES represents the chat history provided to the model as an input.
*/
public static final StringTag GEN_AI_INPUT_MESSAGES = new StringTag(44, "gen_ai.input.messages");

/**
* GEN_AI_OUTPUT_MESSAGES represents the messages returned by the model where each message represents a specific model response (choice, candidate).
*/
public static final StringTag GEN_AI_OUTPUT_MESSAGES = new StringTag(45, "gen_ai.output.messages");

/**
* Creates a {@code StringTag} with the given key and cache it, if it's created before, simply return it without
* creating a new one.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
package org.apache.skywalking.apm.agent.core.context.trace;

public enum SpanLayer {
DB(1), RPC_FRAMEWORK(2), HTTP(3), MQ(4), CACHE(5);
DB(1), RPC_FRAMEWORK(2), HTTP(3), MQ(4), CACHE(5),
GEN_AI(7);

private int code;

Expand Down Expand Up @@ -50,4 +51,8 @@ public static void asHttp(AbstractSpan span) {
public static void asMQ(AbstractSpan span) {
span.setLayer(SpanLayer.MQ);
}

public static void asGenAI(AbstractSpan span) {
span.setLayer(SpanLayer.GEN_AI);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package org.apache.skywalking.apm.agent.core.util;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonUtil {

private static final Gson GSON = new GsonBuilder()
.disableHtmlEscaping()
.create();

public static String toJson(Object src) {
if (src == null) {
return null;
}
return GSON.toJson(src);
}
}
1 change: 1 addition & 0 deletions apm-sniffer/apm-sdk-plugin/spring-plugins/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
<module>spring-webflux-5.x-webclient-plugin</module>
<module>spring-webflux-6.x-webclient-plugin</module>
<module>resttemplate-commons</module>
<module>spring-ai-1.x-plugin</module>
</modules>
<packaging>pom</packaging>

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one or more
~ contributor license agreements. See the NOTICE file distributed with
~ this work for additional information regarding copyright ownership.
~ The ASF licenses this file to You under the Apache License, Version 2.0
~ (the "License"); you may not use this file except in compliance with
~ the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
~
-->

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>spring-plugins</artifactId>
<groupId>org.apache.skywalking</groupId>
<version>9.7.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>spring-ai-1.x-plugin</artifactId>
<packaging>jar</packaging>

<name>spring-ai-1.x-plugin</name>
<url>http://maven.apache.org</url>

<properties>
<maven.compiler.release>17</maven.compiler.release>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-client-chat</artifactId>
<version>1.1.0</version>
<scope>provided</scope>
</dependency>

</dependencies>
</project>
Loading
Loading