Skip to content

Commit

Permalink
Fix Functions self-diagnostics logging on Windows?
Browse files Browse the repository at this point in the history
  • Loading branch information
trask committed Aug 11, 2023
1 parent 3cf3bfe commit 508ee9e
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,20 @@ private DiagnosticsHelper() {}
}

public static void initRpIntegration(Path agentPath) {
if (!Strings.isNullOrEmpty(System.getenv("WEBSITE_SITE_NAME"))) {
// important to check FUNCTIONS_WORKER_RUNTIME before WEBSITE_SITE_NAME
// TODO (heya) how should we report functions windows users who are using app services
// windows attach by manually setting the env vars (which was the old documented way)
if ("java".equals(System.getenv("FUNCTIONS_WORKER_RUNTIME"))) {
rpIntegrationChar = 'f';
functionsRpIntegration = true;
setRpAttachType(agentPath, "functions.codeless");
} else if (!Strings.isNullOrEmpty(System.getenv("WEBSITE_SITE_NAME"))) {
rpIntegrationChar = 'a';
appSvcRpIntegration = true;
setRpAttachType(agentPath, "appsvc.codeless");
} else if (!Strings.isNullOrEmpty(System.getenv("KUBERNETES_SERVICE_HOST"))) {
rpIntegrationChar = 'k';
setRpAttachType(agentPath, "aks.codeless");
} else if ("java".equals(System.getenv("FUNCTIONS_WORKER_RUNTIME"))) {
rpIntegrationChar = 'f';
functionsRpIntegration = true;
setRpAttachType(agentPath, "functions.codeless");
} else if (!Strings.isNullOrEmpty(
System.getenv("APPLICATIONINSIGHTS_SPRINGCLOUD_SERVICE_ID"))) {
rpIntegrationChar = 's';
Expand Down

0 comments on commit 508ee9e

Please sign in to comment.