Skip to content

Commit

Permalink
add profiler to extension class
Browse files Browse the repository at this point in the history
  • Loading branch information
spboyer committed Apr 30, 2024
1 parent 2d2eb18 commit 6b71405
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<PackageVersion Include="Aspire.Npgsql.EntityFrameworkCore.PostgreSQL" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.StackExchange.Redis" Version="$(AspireVersion)" />
<PackageVersion Include="Aspire.Azure.AI.OpenAI" Version="$(AspireVersion)" />
<PackageVersion Include="Microsoft.ApplicationInsights.Profiler.AspNetCore" Version="2.7.1" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery" Version="$(AspireVersion)" />
<PackageVersion Include="Microsoft.Extensions.ServiceDiscovery.Yarp" Version="$(AspireVersion)" />
<!-- Version together with ASP.NET -->
Expand Down
3 changes: 3 additions & 0 deletions src/eShop.ServiceDefaults/Extensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ private static IHostApplicationBuilder AddOpenTelemetryExporters(this IHostAppli
if (!string.IsNullOrEmpty(builder.Configuration["APPLICATIONINSIGHTS_CONNECTION_STRING"]))
{
builder.Services.AddOpenTelemetry().UseAzureMonitor();
// Add Profiler for Azure Monitor
builder.Services.AddApplicationInsightsTelemetry();
builder.Services.AddServiceProfiler();
}

return builder;
Expand Down
1 change: 1 addition & 0 deletions src/eShop.ServiceDefaults/eShop.ServiceDefaults.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<ItemGroup>
<PackageReference Include="Azure.Monitor.OpenTelemetry.AspNetCore" />
<PackageReference Include="Microsoft.ApplicationInsights.Profiler.AspNetCore" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" />
<PackageReference Include="Microsoft.Extensions.Http.Resilience" />
Expand Down

0 comments on commit 6b71405

Please sign in to comment.