Skip to content
Open
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
12 changes: 12 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,8 @@
<cs.ini.version>0.5.4</cs.ini.version>
<cs.caffeine.version>3.1.7</cs.caffeine.version>
<cs.protobuf.version>3.25.5</cs.protobuf.version>
<cs.opentelemetry.version>1.51.0</cs.opentelemetry.version>
<cs.opentelemetry-instrumentation.version>2.16.0</cs.opentelemetry-instrumentation.version>
</properties>

<distributionManagement>
Expand Down Expand Up @@ -427,6 +429,16 @@
<artifactId>commons-validator</artifactId>
<version>${cs.commons-validator.version}</version>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
<version>${cs.opentelemetry.version}</version>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-annotations</artifactId>
<version>${cs.opentelemetry-instrumentation.version}</version>
</dependency>
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
Expand Down
8 changes: 8 additions & 0 deletions server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,14 @@
<version>4.22.1.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>io.opentelemetry.instrumentation</groupId>
<artifactId>opentelemetry-instrumentation-annotations</artifactId>
</dependency>
<dependency>
<groupId>io.opentelemetry</groupId>
<artifactId>opentelemetry-api</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
8 changes: 8 additions & 0 deletions server/src/main/java/com/cloud/api/ApiServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import io.opentelemetry.api.trace.Span;
import io.opentelemetry.instrumentation.annotations.WithSpan;

import com.cloud.cluster.ManagementServerHostVO;
import com.cloud.cluster.dao.ManagementServerHostDao;
import com.cloud.user.Account;
Expand Down Expand Up @@ -619,6 +622,7 @@ public void checkCharacterInkParams(final Map params) {
}

@Override
@WithSpan("ApiServer.handleRequest")
@SuppressWarnings("rawtypes")
public String handleRequest(final Map params, final String responseType, final StringBuilder auditTrailSb) throws ServerApiException {
checkCharacterInkParams(params);
Expand All @@ -628,6 +632,10 @@ public String handleRequest(final Map params, final String responseType, final S

try {
command = (String[])params.get("command");
if (command != null && command.length > 0) {
Span.current().updateName("ApiServer.handleRequest " + command[0]);
Span.current().setAttribute("api.command", command[0]);
}
if (command == null) {
logger.error("invalid request, no command sent");
if (logger.isTraceEnabled()) {
Expand Down
1 change: 1 addition & 0 deletions tools/docker/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ command=/bin/bash -c "mvn -pl client jetty:run -Dsimulator -Dorg.eclipse.jetty.a
directory=/root
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
redirect_stderr=true
user=root

[program:cloudstack-ui]
Expand Down
Loading