Skip to content

Commit d59f1ff

Browse files
authored
Merge pull request #33 from granstel/metrics
Metrics
2 parents dbd5142 + 9c9a278 commit d59f1ff

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/FillInTheTextBot.Api/FillInTheTextBot.Api.csproj

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<PropertyGroup>
44
<TargetFramework>net6.0</TargetFramework>
5-
<Version>1.19.0</Version>
5+
<Version>1.20.0</Version>
66
<PackageReleaseNotes>net6.0</PackageReleaseNotes>
77
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
88
</PropertyGroup>
@@ -15,6 +15,9 @@
1515
<PackageReference Include="NLog.Web.AspNetCore" Version="5.0.0" />
1616
<PackageReference Include="OpenTracing" Version="0.12.1" />
1717
<PackageReference Include="OpenTracing.Contrib.NetCore" Version="0.8.0" />
18+
<PackageReference Include="prometheus-net" Version="7.0.0" />
19+
<PackageReference Include="prometheus-net.AspNetCore" Version="7.0.0" />
20+
<PackageReference Include="prometheus-net.AspNetCore.Grpc" Version="7.0.0" />
1821
</ItemGroup>
1922

2023
<ItemGroup>

src/FillInTheTextBot.Api/Startup.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
using System;
99
using System.Linq;
1010
using FillInTheTextBot.Api.DI;
11+
using Prometheus;
1112

1213
namespace FillInTheTextBot.Api
1314
{
@@ -48,6 +49,8 @@ public void Configure(IApplicationBuilder app, AppConfiguration configuration)
4849
app.UseMiddleware<ExceptionsMiddleware>();
4950

5051
app.UseRouting();
52+
app.UseHttpMetrics();
53+
app.UseGrpcMetrics();
5154

5255
if (configuration.HttpLog.Enabled)
5356
{
@@ -58,7 +61,11 @@ public void Configure(IApplicationBuilder app, AppConfiguration configuration)
5861
});
5962
}
6063

61-
app.UseEndpoints(e => e.MapControllers());
64+
app.UseEndpoints(e =>
65+
{
66+
e.MapControllers();
67+
e.MapMetrics();
68+
});
6269
}
6370
}
6471
}

0 commit comments

Comments
 (0)