47 instantiations of ApplicationKey
Aspire.Dashboard (5)
Model\ResourceTypeDetails.cs (1)
35return new ApplicationKey(ReplicaSetName, InstanceId);
Otlp\Model\OtlpApplication.cs (1)
30public ApplicationKey ApplicationKey => new ApplicationKey(ApplicationName, InstanceId);
Otlp\Model\OtlpHelpers.cs (1)
64return new ApplicationKey(serviceName, serviceInstanceId ?? serviceName);
Otlp\Storage\ApplicationKey.cs (2)
13return new ApplicationKey(Name: name, InstanceId: null); 16return new ApplicationKey(Name: name.Substring(0, separator), InstanceId: name.Substring(separator + 1));
Aspire.Dashboard.Tests (42)
TelemetryRepositoryTests\ApplicationKeyTests.cs (2)
18var key = new ApplicationKey(name, instanceId); 37var key = new ApplicationKey(name, instanceId);
TelemetryRepositoryTests\ApplicationTests.cs (2)
68var applications1 = repository.GetApplications(new ApplicationKey("app1", InstanceId: null)); 84var applications2 = repository.GetApplications(new ApplicationKey("app2", InstanceId: null));
TelemetryRepositoryTests\LogTests.cs (18)
248Assert.True(unviewedCounts1.TryGetValue(new ApplicationKey("TestService", "1"), out var unviewedCount1)); 251Assert.True(unviewedCounts1.TryGetValue(new ApplicationKey("TestService", "2"), out var unviewedCount2)); 254repository.MarkViewedErrorLogs(new ApplicationKey("TestService", "1")); 258Assert.False(unviewedCounts2.TryGetValue(new ApplicationKey("TestService", "1"), out _)); 260Assert.True(unviewedCounts2.TryGetValue(new ApplicationKey("TestService", "2"), out unviewedCount2)); 267Assert.False(unviewedCounts3.TryGetValue(new ApplicationKey("TestService", "1"), out _)); 268Assert.False(unviewedCounts3.TryGetValue(new ApplicationKey("TestService", "2"), out _)); 319Assert.False(unviewedCounts.TryGetValue(new ApplicationKey("TestService", "1"), out _)); 320Assert.False(unviewedCounts.TryGetValue(new ApplicationKey("TestService", "2"), out _)); 328using var subscription = repository.OnNewLogs(applicationKey: new ApplicationKey("TestService", "1"), SubscriptionType.Read, () => Task.CompletedTask); 371Assert.False(unviewedCounts.TryGetValue(new ApplicationKey("TestService", "1"), out _)); 372Assert.True(unviewedCounts.TryGetValue(new ApplicationKey("TestService", "2"), out var unviewedCount)); 409Assert.True(unviewedCounts.TryGetValue(new ApplicationKey("TestService", "1"), out var unviewedCount)); 422ApplicationKey = new ApplicationKey("TestService", "UnknownApplication"), 439var propertyKeys = repository.GetLogPropertyKeys(new ApplicationKey("TestService", "UnknownApplication")); 975var appKey = new ApplicationKey("app1", InstanceId: null); 1126repository.ClearStructuredLogs(new ApplicationKey("app1", "123")); 1200repository.ClearStructuredLogs(new ApplicationKey("app1", null));
TelemetryRepositoryTests\MetricsTests.cs (12)
572var appKey = new ApplicationKey("app1", InstanceId: null); 693var app1Key = new ApplicationKey("app1", InstanceId: null); 697var app2Key = new ApplicationKey("app2", InstanceId: null); 763repository.ClearMetrics(new ApplicationKey("app1", "456")); 768var app1Key = new ApplicationKey("app1", InstanceId: null); 811var app2Key = new ApplicationKey("app2", InstanceId: null); 921repository.ClearMetrics(new ApplicationKey("app1", null)); 926var app1Key = new ApplicationKey("app1", InstanceId: null); 952var app2Key = new ApplicationKey("app2", InstanceId: null); 1033var app1Key = new ApplicationKey("app1", InstanceId: null); 1172ApplicationKey = new ApplicationKey("TestService", "TestId"), 1184ApplicationKey = new ApplicationKey("TestService", "TestId"),
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (1)
35var applicationKey = new ApplicationKey("resource", "resource");
TelemetryRepositoryTests\TraceTests.cs (7)
1113var appKey = new ApplicationKey("app1", InstanceId: null); 1175var appKey = new ApplicationKey("app1", InstanceId: null); 1265var appKey = new ApplicationKey("app1", InstanceId: null); 1311ApplicationKey = new ApplicationKey("TestService", "TestId"), 1704repository.ClearTraces(new ApplicationKey("app1", "123")); 1810repository.ClearTraces(new ApplicationKey("app1", null)); 1902repository.ClearTraces(new ApplicationKey("app1", null));
67 references to ApplicationKey
Aspire.Dashboard (50)
Components\Controls\Chart\ChartContainer.razor.cs (1)
26public required ApplicationKey ApplicationKey { get; set; }
Components\Controls\ClearSignalsButton.razor.cs (1)
28public required Func<ApplicationKey?, Task> HandleClearSignal { get; set; }
Components\Pages\ConsoleLogs.razor.cs (1)
645private async Task ClearConsoleLogs(ApplicationKey? key)
Components\Pages\Metrics.razor.cs (1)
213private Task ClearMetrics(ApplicationKey? key)
Components\Pages\Resources.razor.cs (2)
39private Dictionary<ApplicationKey, int>? _applicationUnviewedErrorCounts; 508private bool ApplicationErrorCountsChanged(Dictionary<ApplicationKey, int> newApplicationUnviewedErrorCounts)
Components\Pages\StructuredLogs.razor.cs (1)
473private Task ClearStructureLogs(ApplicationKey? key)
Components\Pages\Traces.razor.cs (1)
356private Task ClearTraces(ApplicationKey? key)
Components\ResourcesGridColumns\StateColumnDisplay.razor.cs (1)
18public required Dictionary<ApplicationKey, int>? UnviewedErrorCounts { get; set; }
Components\ResourcesGridColumns\UnreadLogErrorsBadge.razor.cs (1)
19public required Dictionary<ApplicationKey, int>? UnviewedErrorCounts { get; set; }
Model\ResourceTypeDetails.cs (2)
24public ApplicationKey GetApplicationKey() 32return ApplicationKey.Create(InstanceId);
Model\StructuredLogsViewModel.cs (2)
16private ApplicationKey? _applicationKey; 27public ApplicationKey? ApplicationKey { get => _applicationKey; set => SetValue(ref _applicationKey, value); }
Model\TracesViewModel.cs (2)
16private ApplicationKey? _applicationKey; 26public ApplicationKey? ApplicationKey { get => _applicationKey; set => SetValue(ref _applicationKey, value); }
Otlp\Model\OtlpApplication.cs (1)
30public ApplicationKey ApplicationKey => new ApplicationKey(ApplicationName, InstanceId);
Otlp\Model\OtlpApplicationView.cs (1)
15public ApplicationKey ApplicationKey => Application.ApplicationKey;
Otlp\Model\OtlpHelpers.cs (1)
29public static ApplicationKey GetApplicationKey(this Resource resource)
Otlp\Storage\ApplicationKey.cs (3)
6public readonly record struct ApplicationKey(string Name, string? InstanceId) : IComparable<ApplicationKey> 8public static ApplicationKey Create(string name) 19public int CompareTo(ApplicationKey other)
Otlp\Storage\GetInstrumentRequest.cs (1)
9public required ApplicationKey ApplicationKey { get; init; }
Otlp\Storage\GetLogsContext.cs (1)
10public required ApplicationKey? ApplicationKey { get; init; }
Otlp\Storage\GetTracesRequest.cs (1)
10public required ApplicationKey? ApplicationKey { get; init; }
Otlp\Storage\Subscription.cs (2)
19public ApplicationKey? ApplicationKey { get; } 23public Subscription(string name, ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback, Action unsubscribe, ExecutionContext? executionContext, TelemetryRepository telemetryRepository)
Otlp\Storage\TelemetryRepository.cs (23)
40private readonly ConcurrentDictionary<ApplicationKey, OtlpApplication> _applications = new(); 47private readonly Dictionary<ApplicationKey, int> _applicationUnviewedErrorLogs = new(); 137public OtlpApplication? GetApplication(ApplicationKey key) 141throw new InvalidOperationException($"{nameof(ApplicationKey)} must have an instance ID."); 148public List<OtlpApplication> GetApplications(ApplicationKey key, bool includeUninstrumentedPeers = false) 164public Dictionary<ApplicationKey, int> GetApplicationUnviewedErrorLogsCount() 178internal void MarkViewedErrorLogs(ApplicationKey? key) 214var key = resource.GetApplicationKey(); 225private (OtlpApplication Application, bool IsNew) GetOrAddApplication(ApplicationKey key, bool uninstrumentedPeer) 254public Subscription OnNewLogs(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 259public Subscription OnNewMetrics(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 264public Subscription OnNewTraces(ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback) 269private Subscription AddSubscription(string name, ApplicationKey? applicationKey, SubscriptionType subscriptionType, Func<Task> callback, List<Subscription> subscriptions) 432public List<string> GetLogPropertyKeys(ApplicationKey? applicationKey) 459public List<string> GetTracePropertyKeys(ApplicationKey? applicationKey) 567private static bool MatchApplications(ApplicationKey applicationKey, List<OtlpApplication> applications) 584var applicationKey = applications[i].ApplicationKey; 606public void ClearTraces(ApplicationKey? applicationKey = null) 643public void ClearStructuredLogs(ApplicationKey? applicationKey = null) 680public void ClearMetrics(ApplicationKey? applicationKey = null) 1085var appKey = ApplicationKey.Create(uninstrumentedPeer.Name); 1221public List<OtlpInstrumentSummary> GetInstrumentsSummaries(ApplicationKey key)
Aspire.Dashboard.Tests (17)
Model\ApplicationsSelectHelpersTests.cs (1)
215var applicationKey = OtlpHelpers.GetApplicationKey(resource);
TelemetryRepositoryTests\ApplicationKeyTests.cs (2)
18var key = new ApplicationKey(name, instanceId); 37var key = new ApplicationKey(name, instanceId);
TelemetryRepositoryTests\LogTests.cs (2)
805var applicationKey = repository.GetApplications().First().ApplicationKey; 975var appKey = new ApplicationKey("app1", InstanceId: null);
TelemetryRepositoryTests\MetricsTests.cs (8)
572var appKey = new ApplicationKey("app1", InstanceId: null); 693var app1Key = new ApplicationKey("app1", InstanceId: null); 697var app2Key = new ApplicationKey("app2", InstanceId: null); 768var app1Key = new ApplicationKey("app1", InstanceId: null); 811var app2Key = new ApplicationKey("app2", InstanceId: null); 926var app1Key = new ApplicationKey("app1", InstanceId: null); 952var app2Key = new ApplicationKey("app2", InstanceId: null); 1033var app1Key = new ApplicationKey("app1", InstanceId: null);
TelemetryRepositoryTests\TelemetryRepositoryTests.cs (1)
35var applicationKey = new ApplicationKey("resource", "resource");
TelemetryRepositoryTests\TraceTests.cs (3)
1113var appKey = new ApplicationKey("app1", InstanceId: null); 1175var appKey = new ApplicationKey("app1", InstanceId: null); 1265var appKey = new ApplicationKey("app1", InstanceId: null);