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