142 references to Tags
aspire (62)
Commands\AgentTelemetryCommand.cs (7)
134
AddIfValid(tags, TelemetryConstants.
Tags
.AgentEventType, parseResult.GetValue(_eventTypeOption), static v => s_knownEventTypes.Contains(v, StringComparer.Ordinal));
135
AddIfValid(tags, TelemetryConstants.
Tags
.AgentClientName, parseResult.GetValue(_clientNameOption), static v => IsSafeIdentifier(v, maxLength: 64));
136
AddIfValid(tags, TelemetryConstants.
Tags
.AgentSessionId, parseResult.GetValue(_sessionIdOption), static v => IsSafeIdentifier(v, maxLength: 128));
137
AddIfValid(tags, TelemetryConstants.
Tags
.AgentSkillName, parseResult.GetValue(_skillNameOption), static v => IsSafeIdentifier(v, maxLength: 128));
138
AddIfValid(tags, TelemetryConstants.
Tags
.AgentToolName, parseResult.GetValue(_toolNameOption), static v => IsSafeIdentifier(v, maxLength: 128));
139
AddIfValid(tags, TelemetryConstants.
Tags
.AgentFileReference, parseResult.GetValue(_fileReferenceOption), IsSafeReference);
140
AddIfValid(tags, TelemetryConstants.
Tags
.AgentEventTimestamp, parseResult.GetValue(_timestampOption), IsValidTimestamp);
Commands\RunCommand.cs (14)
259
runActivity?.SetTag(TelemetryConstants.
Tags
.AppHostDetached, _configuration.GetBool(KnownConfigNames.CliRunDetached) is true);
280
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "project_not_found");
285
runActivity?.SetTag(TelemetryConstants.
Tags
.AppHostIsolated, isolated);
291
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "project_not_found");
302
runActivity?.SetTag(TelemetryConstants.
Tags
.AppHostLanguage, project.LanguageId);
386
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "startup_timeout");
395
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "build_failed");
432
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "startup_timeout");
590
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "canceled");
616
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "canceled");
625
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "project_not_found");
630
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "incompatible_version");
640
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, "backchannel_connection_failed");
657
runActivity?.SetTag(TelemetryConstants.
Tags
.ErrorType, ex.GetType().FullName);
Program.cs (4)
1136
mainActivity.AddTag(TelemetryConstants.
Tags
.ProcessPid, currentProcess.Id);
1137
mainActivity.AddTag(TelemetryConstants.
Tags
.ProcessExecutableName, "aspire");
1172
mainActivity?.SetTag(TelemetryConstants.
Tags
.CommandName, commandName);
1219
mainActivity?.SetTag(TelemetryConstants.
Tags
.ProcessExitCode, exitCode);
Projects\ProcessGuestLauncher.cs (7)
67
AddEvent(activity, ProfilingTelemetry.Events.GuestProcessResolved, TelemetryConstants.
Tags
.ProcessExecutablePath, resolvedCommandPath);
88
AddEvent(activity, ProfilingTelemetry.Events.GuestFirstStdout, TelemetryConstants.
Tags
.ProcessPid, pid);
100
AddEvent(activity, ProfilingTelemetry.Events.GuestFirstStderr, TelemetryConstants.
Tags
.ProcessPid, pid);
154
activity?.SetTag(TelemetryConstants.
Tags
.ProcessPid, execution.ProcessId);
155
AddEvent(activity, ProfilingTelemetry.Events.GuestProcessStarted, TelemetryConstants.
Tags
.ProcessPid, execution.ProcessId);
184
activity?.SetTag(TelemetryConstants.
Tags
.ProcessExitCode, finalExitCode);
185
AddEvent(activity, ProfilingTelemetry.Events.GuestProcessExited, TelemetryConstants.
Tags
.ProcessExitCode, finalExitCode);
Telemetry\AspireCliTelemetry.cs (19)
203
[TelemetryConstants.
Tags
.ExceptionType] = exception.GetType().FullName,
204
[TelemetryConstants.
Tags
.ExceptionMessage] = exception.Message,
205
[TelemetryConstants.
Tags
.ExceptionStackTrace] = exception.StackTrace
280
tagsList.Add(new(TelemetryConstants.
Tags
.MacAddressHash, macAddressHashTask.Result));
281
tagsList.Add(new(TelemetryConstants.
Tags
.DeviceId, deviceIdTask.Result));
284
tagsList.Add(new(TelemetryConstants.
Tags
.InternalMicrosoft, internalMicrosoftResult.IsInternalMicrosoft));
287
tagsList.Add(new(TelemetryConstants.
Tags
.InternalMicrosoftSource, internalMicrosoftResult.Source));
292
tagsList.Add(new(TelemetryConstants.
Tags
.InternalMicrosoftAlias, internalMicrosoftResult.Alias));
297
tagsList.Add(new(TelemetryConstants.
Tags
.InternalMicrosoftDomain, internalMicrosoftResult.Domain));
302
tagsList.Add(new(TelemetryConstants.
Tags
.CliVersion, GetCliVersion()));
303
tagsList.Add(new(TelemetryConstants.
Tags
.CliBuildId, GetCliBuildId()));
308
tagsList.Add(new(TelemetryConstants.
Tags
.IdentityVersion, _executionContext.IdentityVersion));
309
tagsList.Add(new(TelemetryConstants.
Tags
.IdentityChannel, _executionContext.IdentityChannel));
312
tagsList.Add(new(TelemetryConstants.
Tags
.IdentityCommit, _executionContext.IdentityCommit));
318
tagsList.Add(new(TelemetryConstants.
Tags
.CodingAgent, codingAgent));
321
tagsList.Add(new(TelemetryConstants.
Tags
.DeploymentEnvironmentName, _ciEnvironmentDetector.IsCIEnvironment() ? "ci" : "local"));
323
tagsList.Add(new(TelemetryConstants.
Tags
.OsName, GetOsName()));
324
tagsList.Add(new(TelemetryConstants.
Tags
.OsType, GetOsType()));
325
tagsList.Add(new(TelemetryConstants.
Tags
.OsVersion, Environment.OSVersion.Version.ToString()));
Telemetry\ProfilingTelemetry.cs (8)
793
activity.SetTag(TelemetryConstants.
Tags
.ProcessExecutableName, executableName);
794
activity.SetTag(TelemetryConstants.
Tags
.ProcessExecutablePath, executablePath);
880
[TelemetryConstants.
Tags
.ProcessPid] = processId
1037
public void SetCommandName(string commandName) => SetTag(TelemetryConstants.
Tags
.CommandName, commandName);
1176
public void SetProcessExecutableName(string? executableName) => SetTag(TelemetryConstants.
Tags
.ProcessExecutableName, executableName);
1178
public void SetProcessExecutablePath(string? executablePath) => SetTag(TelemetryConstants.
Tags
.ProcessExecutablePath, executablePath);
1180
public void SetProcessExitCode(int exitCode) => SetTag(TelemetryConstants.
Tags
.ProcessExitCode, exitCode);
1182
public void SetProcessId(int processId) => SetTag(TelemetryConstants.
Tags
.ProcessPid, processId);
Utils\SdkInstallHelper.cs (3)
45
activity?.SetTag(TelemetryConstants.
Tags
.SdkDetectedVersion, detectedVersion);
46
activity?.SetTag(TelemetryConstants.
Tags
.SdkMinimumRequiredVersion, minimumRequiredVersion.ToString());
47
activity?.SetTag(TelemetryConstants.
Tags
.SdkCheckResult, ToTelemetryString(checkResult));
Aspire.Cli.Tests (80)
Commands\AgentTelemetryCommandTests.cs (16)
40
Assert.Equal("skill_invocation", tags[TelemetryConstants.
Tags
.AgentEventType]);
41
Assert.Equal("copilot-cli", tags[TelemetryConstants.
Tags
.AgentClientName]);
42
Assert.Equal("11111111-1111-1111-1111-111111111111", tags[TelemetryConstants.
Tags
.AgentSessionId]);
43
Assert.Equal("aspire", tags[TelemetryConstants.
Tags
.AgentSkillName]);
44
Assert.Equal("2026-01-01T00:00:00Z", tags[TelemetryConstants.
Tags
.AgentEventTimestamp]);
70
Assert.Equal("tool_invocation", tags[TelemetryConstants.
Tags
.AgentEventType]);
71
Assert.Equal("aspire-list_resources", tags[TelemetryConstants.
Tags
.AgentToolName]);
72
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentSkillName));
73
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentFileReference));
74
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentClientName));
102
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentFileReference));
103
Assert.Equal("reference_file_read", tags[TelemetryConstants.
Tags
.AgentEventType]);
133
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentFileReference));
159
Assert.False(tags.ContainsKey(TelemetryConstants.
Tags
.AgentEventType));
160
Assert.Equal("aspire", tags[TelemetryConstants.
Tags
.AgentSkillName]);
253
Assert.Equal("aspire/references/deploy.md", tags[TelemetryConstants.
Tags
.AgentFileReference]);
Commands\RunCommandTests.cs (6)
972
Assert.Equal("project_not_found", tags[TelemetryConstants.
Tags
.ErrorType]);
998
Assert.Equal("build_failed", tags[TelemetryConstants.
Tags
.ErrorType]);
4701
Assert.Equal(KnownLanguageId.CSharp, tags[TelemetryConstants.
Tags
.AppHostLanguage]);
4702
Assert.Equal(detached, tags[TelemetryConstants.
Tags
.AppHostDetached]);
4703
Assert.Equal(isolated, tags[TelemetryConstants.
Tags
.AppHostIsolated]);
4704
Assert.Equal("build_failed", tags[TelemetryConstants.
Tags
.ErrorType]);
Commands\StopCommandTests.cs (3)
427
Assert.Equal(CliExitCodes.Success, stopCommandActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode));
435
.Select(activity => Assert.IsType<int>(activity.GetTagItem(TelemetryConstants.
Tags
.ProcessPid)))
438
Assert.All(stopAppHostActivities, activity => Assert.Equal(CliExitCodes.Success, activity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode)));
Git\GitRepositoryTests.cs (4)
136
Assert.Equal("git", startedActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutableName));
137
Assert.Equal("git", startedActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
140
Assert.Equal(0, startedActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode));
141
Assert.True((int)startedActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessPid)! > 0);
Projects\GuestRuntimeTests.cs (5)
305
Assert.Equal(0, preExecuteActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode));
314
Assert.Equal(0, executeActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode));
812
Assert.Equal("dotnet", activity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
815
Assert.Equal(0, activity.GetTagItem(TelemetryConstants.
Tags
.ProcessExitCode));
816
Assert.True((int)activity.GetTagItem(TelemetryConstants.
Tags
.ProcessPid)! > 0);
Telemetry\AspireCliTelemetryTests.cs (28)
127
Assert.Equal(typeof(InvalidOperationException).FullName, eventTags[TelemetryConstants.
Tags
.ExceptionType]);
128
Assert.Equal("Test exception", eventTags[TelemetryConstants.
Tags
.ExceptionMessage]);
238
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.OsName && (string?)t.Value == expectedOsName);
239
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.OsVersion && t.Value is string s && s == Environment.OSVersion.Version.ToString());
240
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.OsType && (string?)t.Value == expectedOsType);
255
Assert.Equal("copilot", activity.GetTagItem(TelemetryConstants.
Tags
.CodingAgent));
265
Assert.DoesNotContain(tags, t => t.Key == TelemetryConstants.
Tags
.CodingAgent);
271
Assert.Equal("aspire.cli.microsoft_internal_source", TelemetryConstants.
Tags
.InternalMicrosoftSource);
272
Assert.Equal("aspire.cli.microsoft_internal_alias", TelemetryConstants.
Tags
.InternalMicrosoftAlias);
273
Assert.Equal("aspire.cli.microsoft_internal_domain", TelemetryConstants.
Tags
.InternalMicrosoftDomain);
286
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoft && t.Value is true);
287
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoftSource && (string?)t.Value == "test source");
288
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoftAlias && (string?)t.Value == "test.alias");
289
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoftDomain && (string?)t.Value == "TEST");
308
Assert.Equal(TelemetryConstants.
Tags
.InternalMicrosoft, tag.Key);
313
Assert.Equal(TelemetryConstants.
Tags
.InternalMicrosoftSource, tag.Key);
377
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.MacAddressHash && (string?)t.Value == "test-mac-hash");
378
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.DeviceId && (string?)t.Value == "test-device-id");
379
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.CliVersion);
380
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.OsName);
461
return [.. tags.Where(t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoft ||
481
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.IdentityVersion && (string?)t.Value == "13.5.0-preview.1.26310.9");
482
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.IdentityChannel && (string?)t.Value == "daily");
483
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.IdentityCommit && (string?)t.Value == "95f0d2968");
487
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.CliVersion);
488
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.CliBuildId);
505
Assert.Contains(tags, t => t.Key == TelemetryConstants.
Tags
.IdentityVersion && (string?)t.Value == "13.5.0");
506
Assert.DoesNotContain(tags, t => t.Key == TelemetryConstants.
Tags
.IdentityCommit);
Telemetry\ProfilingTelemetryTests.cs (8)
83
Assert.Equal("aspire", spawnActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutableName));
84
Assert.Equal(aspirePath, spawnActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
92
Assert.Equal("npm", npmActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutableName));
93
Assert.Equal(npmPath, npmActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
101
Assert.Equal("dotnet", dotnetActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutableName));
102
Assert.Equal("dotnet", dotnetActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
110
Assert.Equal("git", gitActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutableName));
111
Assert.Equal("git", gitActivity.GetTagItem(TelemetryConstants.
Tags
.ProcessExecutablePath));
Telemetry\TelemetryConfigurationTests.cs (1)
322
return [.. tags.Where(t => t.Key == TelemetryConstants.
Tags
.InternalMicrosoft ||
Utils\SdkInstallHelperTests.cs (9)
34
Assert.Equal("9.0.302", tags[TelemetryConstants.
Tags
.SdkDetectedVersion]);
35
Assert.Equal("9.0.302", tags[TelemetryConstants.
Tags
.SdkMinimumRequiredVersion]);
36
Assert.Equal("already_installed", tags[TelemetryConstants.
Tags
.SdkCheckResult]);
60
Assert.Equal("(not found)", tags[TelemetryConstants.
Tags
.SdkDetectedVersion]);
61
Assert.Equal("9.0.302", tags[TelemetryConstants.
Tags
.SdkMinimumRequiredVersion]);
62
Assert.Equal("not_installed", tags[TelemetryConstants.
Tags
.SdkCheckResult]);
86
Assert.Equal("8.0.100", tags[TelemetryConstants.
Tags
.SdkDetectedVersion]);
87
Assert.Equal("9.0.302", tags[TelemetryConstants.
Tags
.SdkMinimumRequiredVersion]);
88
Assert.Equal("not_installed", tags[TelemetryConstants.
Tags
.SdkCheckResult]);