Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge to Live #33029

Merged
merged 2 commits into from
Jul 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions aspnetcore/release-notes/aspnetcore-9.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ This section describes new features for SignalR.

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/signalr.md)]

[!INCLUDE[](~/release-notes/aspnetcore-9/includes/signalrActivities.md)]

## Minimal APIs

This section describes new features for minimal APIs.
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
### Improved Activities for SignalR

SignalR now has an ActivitySource named `Microsoft.AspNetCore.SignalR.Server` that emits events for hub method calls:

* Every method is its own activity, so anything that emits an activity during the hub method call is under the hub method activity.
* Hub method activities don't have a parent. This means they are not bundled under the long-running SignalR connection.

The following example uses the [.NET Aspire dashboard](/dotnet/aspire/fundamentals/dashboard/overview?tabs=bash#using-the-dashboard-with-net-aspire-projects) and the [OpenTelemetry](https://www.nuget.org/packages/OpenTelemetry.Extensions.Hosting) packages:

```xml
<PackageReference Include="OpenTelemetry.Exporter.OpenTelemetryProtocol" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Extensions.Hosting" Version="1.9.0" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.9.0" />
```

Add the following startup code to the `Program.cs` file:

```csharp
// Set OTEL_EXPORTER_OTLP_ENDPOINT environment variable depending on where your OTEL endpoint is
var builder = WebApplication.CreateBuilder(args);

builder.Services.AddRazorPages();
builder.Services.AddSignalR();

builder.Services.AddOpenTelemetry()
.WithTracing(tracing =>
{
if (builder.Environment.IsDevelopment())
{
// We want to view all traces in development
tracing.SetSampler(new AlwaysOnSampler());
}

tracing.AddAspNetCoreInstrumentation();
tracing.AddSource("Microsoft.AspNetCore.SignalR.Server");
});

builder.Services.ConfigureOpenTelemetryTracerProvider(tracing => tracing.AddOtlpExporter());
```

The following is example output from the Aspire Dashboard:

:::image type="content" source="~/release-notes/aspnetcore-9/_static/signalr-activites-events.png" alt-text="Activity list for SignalR Hub method call events":::
1 change: 1 addition & 0 deletions aspnetcore/whats-new/index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ summary: Welcome to what's new in ASP.NET Core docs. Use this page to quickly fi
metadata:
title: ASP.NET Core documentation - What's new?
description: Learn about new and updated content in ASP.NET Core docs.
ms.author: riande
ms.date: 07/01/2024
ms.topic: landing-page
landingContent:
Expand Down
10 changes: 10 additions & 0 deletions quest-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
},
"ImportTriggerLabel": "reQUEST",
"ImportedLabel": "seQUESTered",
"ParentNodes": [
{
"Label": "okr-curation",
"ParentNodeId": 237271
}
],
"DefaultParentNode": 227486,
"WorkItemTags": [
{
"Label": "9.0",
"Tag": "new feature"
},
{
"Label": "okr-curation",
"Tag": "content-curation"
}
]
}
Loading