Skip to content

Commit df1b65e

Browse files
borisahrensBoris Ahrens
andauthored
Re-add Prometheus options (#312)
Co-authored-by: Boris Ahrens <[email protected]>
1 parent a788ca0 commit df1b65e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

src/MalwareSampleExchange.Console/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ WORKDIR /data
55
RUN apk add curl
66
ENTRYPOINT dotnet /data/MalwareSampleExchange.Console.dll
77

8-
ENV ASPNETCORE_URLS="http://0.0.0.0:8080"
8+
ENV ASPNETCORE_URLS="http://0.0.0.0:8080;http://0.0.0.0:9110"
99

1010
LABEL org.opencontainers.image.title="Malware Sample Exchange (MSE) Image" \
1111
org.opencontainers.image.description="Malware Sample Exchange (MSE)" \
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
namespace MalwareSampleExchange.Console;
2+
3+
public class PrometheusOptions
4+
{
5+
public int Port { get; set; } = 9110;
6+
}

src/MalwareSampleExchange.Console/Startup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,12 @@ public void ConfigureServices(IServiceCollection services)
130130

131131
public void Configure(IApplicationBuilder app)
132132
{
133-
app.UsePrometheusServer(options => options.Port = 8080);
133+
app.UsePrometheusServer(q =>
134+
{
135+
var options = new PrometheusOptions();
136+
_configuration.GetSection("Prometheus").Bind(options);
137+
q.Port = options.Port;
138+
});
134139

135140
app.UsePrometheusRequestDurations(q =>
136141
{

0 commit comments

Comments
 (0)