I'm setting up a Prometheus exporter for my ASP.NET Core 3.1 app.
I've imported
<PackageReference Include="prometheus-net.AspNetCore" Version="4.1.1" />
And this is what I have configured:
public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
{
...
app.UseRouting();
app.UseHttpMetrics();
app.UseEndpoints(endpoints =>
{
endpoints.MapControllers();
endpoints.MapMetrics();
});
}
This will expose the metrics endpoint on the same port as the rest of the ASP.NET Core application, for example: my.api.com:80/metrics.
What do I need to do to expose the /metrics endpoint on another port? I would like to have my API running on port 80, and the /metrics endpoint on port 9102.
Can't really find any docs about that.
Edit
I'm deploying this into Kubernetes