Skip to content

Instantly share code, notes, and snippets.

@aevitas
Created December 13, 2019 14:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aevitas/5a52a09eb981db8241797c5b7e028e46 to your computer and use it in GitHub Desktop.
Save aevitas/5a52a09eb981db8241797c5b7e028e46 to your computer and use it in GitHub Desktop.
public void ConfigureServices(IServiceCollection services)
{
services.AddSingleton<MetricReporter>();
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<ResponseMetricMiddleware>();
app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment