Skip to content

Commit a0cbb0e

Browse files
Harshil Lodhidivman25
authored andcommitted
Adding telemetry.
# Conflicts: # Tasks/DockerV0/container.ts # Tasks/DockerV1/container.ts
1 parent f4e8fa6 commit a0cbb0e

File tree

5 files changed

+43
-4
lines changed

5 files changed

+43
-4
lines changed

Tasks/DockerV0/container.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,12 @@ var action = tl.getInput("action", true);
3535
var telemetry = {
3636
registryType: registryType,
3737
command: action
38-
command: action !== "Run a Docker command" ? action : tl.getInput("customCommand", true)
3938
};
4039

41-
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
42-
"TaskEndpointId",
43-
"DockerV0",
40+
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
41+
"TaskEndpointId",
42+
"DockerV0",
43+
JSON.stringify(telemetry));
4444
JSON.stringify(telemetry));
4545
/* tslint:disable:no-var-requires */
4646
require({

Tasks/DockerV1/container.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,15 @@ console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
5555

5656
var commandImplementation = require("./containercommand");
5757
if (command in dockerCommandMap) {
58+
var telemetry = {
59+
registryType: registryType,
60+
command: command
61+
};
62+
63+
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
64+
"TaskEndpointId",
65+
"DockerV1",
66+
JSON.stringify(telemetry));
5867
commandImplementation = require(dockerCommandMap[command]);
5968
}
6069

Tasks/HelmDeployV0/src/helm.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,16 @@ async function run() {
5858

5959
var helmCli : helmcli = new helmcli();
6060
helmCli.login();
61+
var connectionType = tl.getInput("connectionType", true);
62+
var telemetry = {
63+
connectionType: connectionType,
64+
command: command
65+
};
66+
67+
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
68+
"TaskEndpointId",
69+
"HelmDeployV0",
70+
JSON.stringify(telemetry));
6171

6272
try {
6373
switch (command){

Tasks/KubernetesV0/src/kubernetes.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,15 @@ function executeKubectlCommand(clusterConnection: ClusterConnection) : any {
7272
var command = tl.getInput("command", true);
7373
var result = "";
7474
var ouputVariableName = tl.getInput("kubectlOutput", false);
75+
var telemetry = {
76+
registryType: registryType,
77+
command: command
78+
};
79+
80+
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
81+
"TaskEndpointId",
82+
"KubernetesV0",
83+
JSON.stringify(telemetry));
7584
return kubectl.run(clusterConnection, command, (data) => result += data)
7685
.fin(function cleanup() {
7786
if(ouputVariableName) {

Tasks/KubernetesV1/src/kubernetes.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ tl.setResourcePath(path.join(__dirname, '..' , 'task.json'));
1111
// Change to any specified working directory
1212
tl.cd(tl.getInput("cwd"));
1313

14+
var registryType = tl.getInput("containerRegistryType", true);
1415
var command = tl.getInput("command", true);
16+
1517
var kubeconfigfilePath;
1618
if (command === "logout") {
1719
kubeconfigfilePath = tl.getVariable("KUBECONFIG");
@@ -67,6 +69,15 @@ function executeKubectlCommand(clusterConnection: ClusterConnection, command: st
6769
commandImplementation = require(commandMap[command]);
6870
}
6971

72+
var telemetry = {
73+
registryType: registryType,
74+
command: command
75+
};
76+
77+
console.log("##vso[telemetry.publish area=%s;feature=%s]%s",
78+
"TaskEndpointId",
79+
"KubernetesV1",
80+
JSON.stringify(telemetry));
7081
var result = "";
7182
return commandImplementation.run(clusterConnection, command, (data) => result += data)
7283
.fin(function cleanup() {

0 commit comments

Comments
 (0)