# TraconDiagnosticsCollector

> Tracon documentation. Tracon is a .NET package family that adds a control
> plane on Microsoft Agent Framework, published as NuGet packages that run
> inside your own ASP.NET Core application.
>
> Page: https://tracon.dev/api/tracon.tracondiagnosticscollector/
> Summary: TraconDiagnosticsCollector: Collects the installation's self-diagnostic summary report.

<div class="api-provenance">Namespace Tracon · Assembly <code>Tracon.Core.dll</code></div>

Collects the installation's self-diagnostic summary report.

```csharp
public sealed class TraconDiagnosticsCollector
```

<dl class="api-relations"><dt>Inheritance</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object">object</a> ← <a href="/api/tracon.tracondiagnosticscollector/">TraconDiagnosticsCollector</a></dd><dt>Inherited Members</dt><dd><a href="https://learn.microsoft.com/dotnet/api/system.object.gettype">object.GetType()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.tostring">object.ToString()</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)">object.Equals(object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)">object.Equals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.referenceequals">object.ReferenceEquals(object?, object?)</a>, <a href="https://learn.microsoft.com/dotnet/api/system.object.gethashcode">object.GetHashCode()</a></dd></dl>

## Remarks

**Has no side effects.** It makes no model calls: model provider
status is read from the cached health-check results without triggering
a new health check. When SQL persistence is registered, it performs a light
connectivity probe through [ISqlPersistenceDiagnostics.GetSnapshotAsync](/api/tracon.isqlpersistencediagnostics/#Tracon_ISqlPersistenceDiagnostics_GetSnapshotAsync_System_Threading_CancellationToken_);
it does not apply migrations.

The generated [TraconDiagnosticsReport](/api/tracon.tracondiagnosticsreport/) contains no `secret`.

`AddTracon` registers the collector as a singleton; resolve it with
`GetRequiredService<TraconDiagnosticsCollector>`.

## Methods

### <a id="Tracon_TraconDiagnosticsCollector_CollectAsync_System_Threading_CancellationToken_"></a> CollectAsync\(CancellationToken\)

Collects the installation diagnostics report.

```csharp
public ValueTask<TraconDiagnosticsReport> CollectAsync(CancellationToken cancellationToken = default)
```

#### Parameters

`cancellationToken` [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken)

The cancellation token.

#### Returns

 [ValueTask](https://learn.microsoft.com/dotnet/api/system.threading.tasks.valuetask\-1)<[TraconDiagnosticsReport](/api/tracon.tracondiagnosticsreport/)\>

The report. [TraconDiagnosticsReport.UiEmbedded](/api/tracon.tracondiagnosticsreport/#Tracon_TraconDiagnosticsReport_UiEmbedded) always
returns [false](https://learn.microsoft.com/dotnet/csharp/language-reference/builtin-types/bool) because the field belongs to the
`Tracon.AspNetCore` layer, which `Tracon.Core` does not
know. The caller must set it with a `with` expression.
