Skip to content

Commit

Permalink
Don't hardcode metrics port for CI Integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mhelleborg committed Jun 6, 2024
1 parent f34e55e commit 0dc9669
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions Integration/Shared/Runtime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Dolittle.Runtime.Domain.Platform;
using Dolittle.Runtime.Domain.Tenancy;
using Dolittle.Runtime.Execution;
using Dolittle.Runtime.Metrics.Configuration;
using Dolittle.Runtime.Metrics.Hosting;
using Dolittle.Runtime.Server.Web;
using Dolittle.Runtime.Services;
Expand Down Expand Up @@ -74,6 +75,10 @@ public static RunningRuntime CreateAndStart(int numberOfTenants)
builder.Private = new EndpointConfiguration { Port = 0 };
builder.Public = new EndpointConfiguration { Port = 0 };
});
coll.AddOptions<MetricsServerConfiguration>().Configure(builder =>
{
builder.Port = 0;
});
})
.AddActorSystem()
.AddMetrics()
Expand Down
4 changes: 2 additions & 2 deletions Source/Metrics/Configuration/MetricsServerConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ public record MetricsServerConfiguration
/// <summary>
/// Gets a value indicating whether or not the endpoint should be enabled.
/// </summary>
public bool Enabled { get; init; } = true; // TODO: It would be cool if this made it so that the scoped server host didn't start
public bool Enabled { get; set; } = true; // TODO: It would be cool if this made it so that the scoped server host didn't start

/// <summary>
/// Gets the port to serve the endpoint on.
/// </summary>
public int Port { get; init; } = 9700;
public int Port { get; set; } = 9700;
}

0 comments on commit 0dc9669

Please sign in to comment.