Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmontemagno committed Dec 22, 2023
2 parents bc40243 + 510d8b5 commit d01f411
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions .devcontainer/dotnet-observability/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
}
},
"forwardPorts": [
3000,
9090,
9411,
32000,
32001
],
Expand All @@ -29,6 +32,15 @@
"cpus": 4
},
"portsAttributes": {
"3000": {
"label": "Grafana"
},
"9090": {
"label": "Prometheus"
},
"9411": {
"label": "Zipkin"
},
"32001": {
"label": "Back End"
},
Expand Down
2 changes: 1 addition & 1 deletion dotnet-observability/eShopLite/Products/Products.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.*-*" />
<PackageReference Include="Microsoft.Extensions.Telemetry" Version="8.0.*-*" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="8.0.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.*-*" />
</ItemGroup>

<ItemGroup>
Expand Down
4 changes: 3 additions & 1 deletion dotnet-observability/eShopLite/Products/Program.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
using Microsoft.EntityFrameworkCore;
vusing Microsoft.EntityFrameworkCore;
using Products.Data;
using Products.Endpoints;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddDbContext<ProductDataContext>(options =>
options.UseSqlite(builder.Configuration.GetConnectionString("ProductsContext") ?? throw new InvalidOperationException("Connection string 'ProductsContext' not found.")));

// Add observability code here

// Add services to the container.
var app = builder.Build();

Expand Down
2 changes: 1 addition & 1 deletion dotnet-observability/eShopLite/Store/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();

// Add logging
// Add observability code here


var app = builder.Build();
Expand Down
4 changes: 2 additions & 2 deletions dotnet-observability/eShopLite/Store/Store.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Telemetry" Version="8.0.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.6.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.6.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.AspNetCore" Version="1.7.*-*" />
<PackageReference Include="OpenTelemetry.Instrumentation.Http" Version="1.7.*-*" />
</ItemGroup>

</Project>

0 comments on commit d01f411

Please sign in to comment.