Skip to content

Commit 148b861

Browse files
authored
Check Azure Spring Cloud before AKS in RP integration (#4000)
1 parent 77b32ad commit 148b861

File tree

1 file changed

+5
-4
lines changed
  • agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics

1 file changed

+5
-4
lines changed

agent/agent-tooling/src/main/java/com/microsoft/applicationinsights/agent/internal/diagnostics/DiagnosticsHelper.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,16 @@ public static void initRpIntegration(Path agentPath) {
4747
if (RpAttachType.INTEGRATED_AUTO.equals(RpAttachType.getRpAttachType())) {
4848
appSvcRpIntegratedAuto = true;
4949
}
50+
} else if (!Strings.isNullOrEmpty(
51+
System.getenv("APPLICATIONINSIGHTS_SPRINGCLOUD_SERVICE_ID"))) {
52+
// Spring Cloud needs to be checked before AKS since it runs on AKS
53+
PropertyHelper.setRpIntegrationChar('s');
54+
setRpAttachType(agentPath, "springcloud.codeless");
5055
} else if (!Strings.isNullOrEmpty(System.getenv("AKS_ARM_NAMESPACE_ID"))) {
5156
// AKS_ARM_NAMESPACE_ID is an env var available in AKS only and it's also used as the AKS
5257
// attach rate numerator
5358
PropertyHelper.setRpIntegrationChar('k');
5459
setRpAttachType(agentPath, "aks.codeless");
55-
} else if (!Strings.isNullOrEmpty(
56-
System.getenv("APPLICATIONINSIGHTS_SPRINGCLOUD_SERVICE_ID"))) {
57-
PropertyHelper.setRpIntegrationChar('s');
58-
setRpAttachType(agentPath, "springcloud.codeless");
5960
} else {
6061
RpAttachType.setRpAttachType(RpAttachType.STANDALONE_AUTO); // default
6162
}

0 commit comments

Comments
 (0)