use .net 8 app
This commit is contained in:
@ -303,7 +303,7 @@ You should be able to log in `https://gitea.kube.rocks` with chosen admin creden
|
||||
|
||||
### Push a basic Web API project
|
||||
|
||||
Let's generate a basic .NET Web API project. Create a new dotnet project like following (you may install [last .NET SDK](https://dotnet.microsoft.com/en-us/download)):
|
||||
Let's generate a basic .NET Web API project. Create a new dotnet 8 project like following (you may install [.NET 8 SDK](https://dotnet.microsoft.com/en-us/download)):
|
||||
|
||||
```sh
|
||||
mkdir kuberocks-demo
|
||||
@ -311,7 +311,7 @@ cd kuberocks-demo
|
||||
dotnet new sln
|
||||
dotnet new gitignore
|
||||
dotnet new editorconfig
|
||||
dotnet new webapi -o src/KubeRocks.WebApi
|
||||
dotnet new webapi -o src/KubeRocks.WebApi --use-controllers
|
||||
dotnet sln add src/KubeRocks.WebApi
|
||||
git init
|
||||
git add .
|
||||
|
@ -193,7 +193,7 @@ Firstly create following files in root of your repo that we'll use for building
|
||||
{{< highlight host="kuberocks-demo" file="Dockerfile" >}}
|
||||
|
||||
```Dockerfile
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:7.0
|
||||
FROM mcr.microsoft.com/dotnet/aspnet:8.0
|
||||
|
||||
WORKDIR /publish
|
||||
COPY /publish .
|
||||
@ -253,7 +253,7 @@ jobs:
|
||||
type: registry-image
|
||||
source:
|
||||
repository: mcr.microsoft.com/dotnet/sdk
|
||||
tag: "7.0"
|
||||
tag: "8.0"
|
||||
inputs:
|
||||
- name: source-code
|
||||
path: .
|
||||
|
@ -135,7 +135,11 @@ builder.Services.AddOpenTelemetry()
|
||||
{
|
||||
b
|
||||
.AddAspNetCoreInstrumentation()
|
||||
.AddPrometheusExporter();
|
||||
.AddPrometheusExporter()
|
||||
.AddMeter(
|
||||
"Microsoft.AspNetCore.Hosting",
|
||||
"Microsoft.AspNetCore.Server.Kestrel"
|
||||
);
|
||||
});
|
||||
|
||||
var app = builder.Build();
|
||||
@ -149,9 +153,7 @@ app.UseOpenTelemetryPrometheusScrapingEndpoint();
|
||||
|
||||
Relaunch app and go to `https://demo.kube.rocks/metrics` to confirm it's working. It should show metrics after each endpoint call, simply try `https://demo.kube.rocks/Articles`.
|
||||
|
||||
{{< alert >}}
|
||||
.NET metrics are currently pretty basic, but the next .NET 8 version will provide far better metrics from internal components allowing some [useful dashboard](https://github.com/JamesNK/aspnetcore-grafana).
|
||||
{{< /alert >}}
|
||||
Now you can easily import ASP.NET [specific grafana dashboards](https://github.com/dotnet/aspire/tree/main/src/Grafana) for visualizing.
|
||||
|
||||
#### Hide internal endpoints
|
||||
|
||||
|
Reference in New Issue
Block a user