Skip to content

Commit

Permalink
Metrics on 8080 (#303)
Browse files Browse the repository at this point in the history
* Update to dotnet 8

* Build and format with same dotnet version

* Expose metrics on 8080

---------

Co-authored-by: Boris Ahrens <boris.ahrens@gdata.de>
  • Loading branch information
borisahrens and Boris Ahrens authored Feb 22, 2024
1 parent de4aeac commit eec5bfb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 45 deletions.
2 changes: 0 additions & 2 deletions src/MalwareSampleExchange.Console/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ WORKDIR /data

ENTRYPOINT dotnet /data/MalwareSampleExchange.Console.dll

ENV ASPNETCORE_URLS="http://0.0.0.0:8080"

LABEL org.opencontainers.image.title="Malware Sample Exchange (MSE) Image" \
org.opencontainers.image.description="Malware Sample Exchange (MSE)" \
org.opencontainers.image.url="https://github.com/GDATASoftwareAG/mse" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,9 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Remove="Properties\launchSettings.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="Properties\" />
</ItemGroup>
</Project>
1 change: 1 addition & 0 deletions src/MalwareSampleExchange.Console/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,6 @@ await Host.CreateDefaultBuilder(args)
{
builder.UseStartup<Startup>();
builder.UseKestrel();
builder.UseUrls("http://0.0.0.0:8080");
})
.RunConsoleAsync();
6 changes: 0 additions & 6 deletions src/MalwareSampleExchange.Console/PrometheusOptions.cs

This file was deleted.

28 changes: 0 additions & 28 deletions src/MalwareSampleExchange.Console/Properties/launchSettings.json

This file was deleted.

13 changes: 4 additions & 9 deletions src/MalwareSampleExchange.Console/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -126,20 +126,15 @@ public void ConfigureServices(IServiceCollection services)

public void Configure(IApplicationBuilder app)
{
app.UsePrometheusServer(q =>
{
var options = new PrometheusOptions();
_configuration.GetSection("Prometheus").Bind(options);
q.Port = options.Port;
});
app.UsePrometheusServer();

app.UsePrometheusRequestDurations(q =>
{
q.IncludeMethod = true;
q.IncludePath = true;
q.Buckets = new[] { 0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 20.0, 30.0, 60.0 };
q.IgnoreRoutesConcrete = new[] { "/metrics", "/favicon.ico", "/index.html", "/" };
q.IgnoreRoutesStartWith = new[] { "/swagger" };
q.Buckets = [0.005, 0.01, 0.025, 0.05, 0.075, 0.1, 0.25, 0.5, 0.75, 1.0, 2.5, 5.0, 7.5, 10.0, 20.0, 30.0, 60.0];
q.IgnoreRoutesConcrete = ["/metrics", "/favicon.ico", "/index.html", "/"];
q.IgnoreRoutesStartWith = ["/swagger"];
});

app.UseDefaultFiles()
Expand Down

0 comments on commit eec5bfb

Please sign in to comment.