title: How to integrate Prometheus with .NET Core application?
body: <p>I am trying to integrate Prometheus for my C# .NET Core Console application. I am <strong>not developing an ASP.NET Core application</strong>. How do I send the metrics data to prometheus the way we usually do for ASP.NET Core application?</p>
  <p>In ASP.NET Core application,</p>
  <p>Open Startup.cs and update ConfigureServices and Configure to look something along the lines of:</p>
  <pre><code>public void ConfigureServices(IServiceCollection services)
  {
      services.AddSingleton&lt;MetricReporter&gt;();
  
      services.AddControllers();
  }
  
  public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
  {
      // Other middleware components omitted for brevity
  
      // Make sure these calls are made before the call to UseEndPoints.
      app.UseMetricServer();
      app.UseMiddleware&lt;ResponseMetricMiddleware&gt;();
  
      app.UseEndpoints(endpoints =&gt; { endpoints.MapControllers(); });
  }
  </code></pre>
  <p>How can I do this for a .NET Core console application?</p>