Skip to content

Commit

Permalink
Bind prometheus on different port
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Jansen <[email protected]>
  • Loading branch information
farodin91 committed Mar 22, 2022
1 parent 4c5780e commit 8427d9b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>0.6.0</Version>
<Version>0.7.0</Version>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
Expand Down
6 changes: 6 additions & 0 deletions src/MalwareSampleExchange.Console/PrometheusOptions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace MalwareSampleExchange.Console;

public class PrometheusOptions
{
public int Port { get; set; } = 9110;
}
6 changes: 3 additions & 3 deletions src/MalwareSampleExchange.Console/Startup.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Text.RegularExpressions;
using Microsoft.AspNetCore.Authentication;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
Expand Down Expand Up @@ -130,7 +128,9 @@ public void Configure(IApplicationBuilder app)
{
app.UsePrometheusServer(q =>
{
//q.Port = 6502;
var options = new PrometheusOptions();
_configuration.GetSection("Prometheus").Bind(options);
q.Port = options.Port;
});

app.UsePrometheusRequestDurations(q =>
Expand Down

0 comments on commit 8427d9b

Please sign in to comment.