Skip to content

Commit e5ea63f

Browse files
committed
Send telemetry when HDI cluster role type is READER
1 parent cb2dd75 commit e5ea63f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Utils/hdinsight-node-common/src/com/microsoft/azure/hdinsight/sdk/cluster/HDInsightNewAPI/ClusterOperationNewAPIImpl.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ public Observable<Boolean> isProbeGetConfigurationSucceed(
8989
if (err instanceof ForbiddenHttpErrorStatus) {
9090
setRoleType(HDInsightUserRoleType.READER);
9191
log().info("HDInsight user role type is READER. Request cluster ID: " + clusterId);
92+
93+
// Send telemetry when cluster role type is READER
94+
final Map<String, String> properties = new HashMap<>();
95+
properties.put("ClusterID", clusterId);
96+
properties.put("RoleType", "READER");
97+
properties.put("StatusCode", String.valueOf(((HttpErrorStatus) err).getStatusCode()));
98+
properties.put("ErrorDetails", ((HttpErrorStatus) err).getErrorDetails());
99+
AppInsightsClient.createByType(AppInsightsClient.EventType.Telemetry, this.getClass().getSimpleName(), null, properties);
92100
return Observable.just(true);
93101
} else {
94102
if (err instanceof HttpErrorStatus) {

0 commit comments

Comments
 (0)