Skip to content

Commit e8bd6ad

Browse files
committed
Add missing properties for web app telemetry
1 parent cf57b1a commit e8bd6ad

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/src/com/microsoft/azure/toolkit/intellij/webapp/runner/webappconfig/WebAppRunState.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@
3737
import java.io.IOException;
3838
import java.net.URISyntaxException;
3939
import java.net.URL;
40-
import java.util.Collections;
41-
import java.util.HashSet;
42-
import java.util.Map;
43-
import java.util.Objects;
40+
import java.util.*;
4441

4542
import static com.microsoft.intellij.ui.messages.AzureBundle.message;
4643

@@ -131,7 +128,10 @@ protected void onSuccess(WebAppBase result, @NotNull RunProcessHandler processHa
131128

132129
@Override
133130
protected Map<String, String> getTelemetryMap() {
134-
return webAppSettingModel.getTelemetryProperties(Collections.EMPTY_MAP);
131+
final Map<String, String> properties = new HashMap<>();
132+
properties.put("artifactType", webAppConfiguration.getAzureArtifactType() == null ? null : webAppConfiguration.getAzureArtifactType().name());
133+
properties.putAll(webAppSettingModel.getTelemetryProperties(Collections.EMPTY_MAP));
134+
return properties;
135135
}
136136

137137
@NotNull

Utils/azuretools-core/src/com/microsoft/azuretools/core/mvp/model/webapp/WebAppSettingModel.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,13 +76,14 @@ public Map<String, String> getTelemetryProperties(Map<String, String> properties
7676
result.putAll(properties);
7777
}
7878
result.put(TelemetryConstants.RUNTIME, os == OperatingSystem.LINUX ?
79-
"linux-" + getLinuxRuntime().toString() : "windows-" + getWebContainer());
79+
"linux-" + getLinuxRuntime().toString() : "windows-" + getWebContainer() + jdkVersion == null ? "" : "-" + jdkVersion.toString());
8080
result.put(TelemetryConstants.WEBAPP_DEPLOY_TO_SLOT, String.valueOf(isDeployToSlot()));
8181
result.put(TelemetryConstants.SUBSCRIPTIONID, getSubscriptionId());
8282
result.put(TelemetryConstants.CREATE_NEWWEBAPP, String.valueOf(isCreatingNew()));
8383
result.put(TelemetryConstants.CREATE_NEWASP, String.valueOf(isCreatingAppServicePlan()));
8484
result.put(TelemetryConstants.CREATE_NEWRG, String.valueOf(isCreatingResGrp()));
8585
result.put(TelemetryConstants.FILETYPE, WebAppUtils.getFileType(getTargetName()));
86+
result.put(TelemetryConstants.PRICING_TIER, pricing);
8687
} catch (final Exception ignore) {
8788
}
8889
return result;

Utils/azuretools-core/src/com/microsoft/azuretools/telemetry/TelemetryConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ public class TelemetryConstants {
197197
public static final String JAVA_APPNAME = "javaAppName";
198198
public static final String SIGNIN_METHOD = "signinMethod";
199199
public static final String AZURE_ENVIRONMENT = "azureEnvironment";
200+
public static final String PRICING_TIER = "pricingTier";
200201

201202
public static final Map<String, String> signInSPProp = new HashMap<>();
202203
public static final Map<String, String> signInDCProp = new HashMap<>();

0 commit comments

Comments
 (0)