Skip to content

Instantly share code, notes, and snippets.

@wullemsb
Created December 5, 2025 07:56
Show Gist options
  • Select an option

  • Save wullemsb/789928e3e2939c3a692af6d967b184e7 to your computer and use it in GitHub Desktop.

Select an option

Save wullemsb/789928e3e2939c3a692af6d967b184e7 to your computer and use it in GitHub Desktop.
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using OpenTelemetry.Metrics;
var builder= Host.CreateDefaultBuilder(args);
builder.ConfigureServices(s =>
{
s.AddOpenTelemetry()
.WithMetrics(metrics =>
{
metrics
.AddMeter("MyCompany.MyApp.*");
});
});
var app = builder.Build();
app.Run();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment