diff --git a/Directory.Packages.props b/Directory.Packages.props
index c0f17252d6..353391fdaf 100644
--- a/Directory.Packages.props
+++ b/Directory.Packages.props
@@ -119,6 +119,7 @@
+
@@ -151,11 +152,13 @@
+
+
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/AspNetCoreBenchmarks.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/AspNetCoreBenchmarks.cs
new file mode 100644
index 0000000000..9a778ad346
--- /dev/null
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/AspNetCoreBenchmarks.cs
@@ -0,0 +1,146 @@
+// Copyright The OpenTelemetry Authors
+// SPDX-License-Identifier: Apache-2.0
+
+using BenchmarkDotNet.Attributes;
+using Greet;
+using Grpc.Core;
+using Grpc.Net.Client;
+using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.TestHost;
+using Microsoft.Extensions.Configuration;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using OpenTelemetry.Metrics;
+using OpenTelemetry.Trace;
+
+namespace OpenTelemetry.Instrumentation.AspNetCore.Benchmarks;
+
+[MemoryDiagnoser]
+public class AspNetCoreBenchmarks
+{
+ private static readonly Uri BaseAddress = new("/", UriKind.Relative);
+
+ private readonly HelloRequest helloRequest = new();
+ private HttpClient? httpClient;
+ private Greeter.GreeterClient? grpcClient;
+ private WebApplication? app;
+ private TracerProvider? tracerProvider;
+ private MeterProvider? meterProvider;
+
+ [Flags]
+ public enum EnableInstrumentationOption
+ {
+ ///
+ /// Instrumentation is not enabled for any signal.
+ ///
+ None = 0,
+
+ ///
+ /// Instrumentation is enabled only for Traces.
+ ///
+ Traces = 1,
+
+ ///
+ /// Instrumentation is enabled only for Metrics.
+ ///
+ Metrics = 2,
+ }
+
+ [Params(EnableInstrumentationOption.None, EnableInstrumentationOption.Traces, EnableInstrumentationOption.Metrics, EnableInstrumentationOption.Traces | EnableInstrumentationOption.Metrics)]
+ public EnableInstrumentationOption EnableInstrumentation { get; set; }
+
+ [GlobalSetup]
+ public async Task StartServer()
+ {
+ await this.StartWebApplicationAsync();
+
+ KeyValuePair[] config =
+ [
+ new("OTEL_DOTNET_EXPERIMENTAL_ASPNETCORE_ENABLE_GRPC_INSTRUMENTATION", "true"),
+ ];
+
+ IConfiguration configuration = new ConfigurationBuilder()
+ .AddInMemoryCollection(config)
+ .Build();
+
+ if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces))
+ {
+ this.tracerProvider = Sdk.CreateTracerProviderBuilder()
+ .ConfigureServices((services) => services.AddSingleton(configuration))
+ .AddAspNetCoreInstrumentation()
+ .Build();
+ }
+
+ if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Metrics))
+ {
+ var exportedItems = new List();
+
+ this.meterProvider = Sdk.CreateMeterProviderBuilder()
+ .ConfigureServices((services) => services.AddSingleton(configuration))
+ .AddAspNetCoreInstrumentation()
+ .AddInMemoryExporter(exportedItems)
+ .Build();
+ }
+ }
+
+ [GlobalCleanup]
+ public async Task StopServer()
+ {
+ this.httpClient?.Dispose();
+
+ if (this.app != null)
+ {
+ await this.app.StopAsync();
+ await this.app.DisposeAsync();
+ }
+
+ this.tracerProvider?.Dispose();
+ this.meterProvider?.Dispose();
+ }
+
+ [Benchmark]
+ public async Task HttpGet()
+ {
+ using var httpResponse = await this.httpClient!.GetAsync(BaseAddress).ConfigureAwait(false);
+ httpResponse.EnsureSuccessStatusCode();
+ }
+
+ [Benchmark]
+ public async Task GrpcGet() =>
+ await this.grpcClient!.SayHelloAsync(this.helloRequest);
+
+ private async Task StartWebApplicationAsync()
+ {
+ var builder = WebApplication.CreateBuilder();
+
+ builder.Logging.ClearProviders();
+ builder.WebHost.UseTestServer();
+
+ builder.Services.AddGrpc();
+
+ var app = builder.Build();
+
+ app.MapGet("/", async context => await context.Response.WriteAsync("Hello World!"));
+
+ app.MapGrpcService();
+
+ await app.StartAsync();
+
+ this.app = app;
+ this.httpClient = app.GetTestClient();
+
+ var channel = GrpcChannel.ForAddress("http://localhost", new()
+ {
+ HttpClient = this.httpClient,
+ });
+
+ this.grpcClient = new Greeter.GreeterClient(channel);
+ }
+
+ private sealed class GreeterService : Greeter.GreeterBase
+ {
+ public override Task SayHello(HelloRequest request, ServerCallContext context) =>
+ Task.FromResult(new HelloReply { Message = "Hello " + request.Name });
+ }
+}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationBenchmarks.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationBenchmarks.cs
deleted file mode 100644
index a826051513..0000000000
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationBenchmarks.cs
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-using BenchmarkDotNet.Attributes;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Logging;
-using OpenTelemetry.Metrics;
-using OpenTelemetry.Trace;
-
-/*
-BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1702/22H2/2022Update/SunValley2)
-Intel Core i7-8850H CPU 2.60GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
-.NET SDK=7.0.203
- [Host] : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2
- DefaultJob : .NET 7.0.5 (7.0.523.17405), X64 RyuJIT AVX2
-
-
-| Method | EnableInstrumentation | Mean | Error | StdDev | Gen0 | Allocated |
-|--------------------------- |---------------------- |---------:|--------:|--------:|-------:|----------:|
-| GetRequestForAspNetCoreApp | None | 136.8 us | 1.56 us | 1.46 us | 0.4883 | 2.45 KB |
-| GetRequestForAspNetCoreApp | Traces | 148.1 us | 0.88 us | 0.82 us | 0.7324 | 3.57 KB |
-| GetRequestForAspNetCoreApp | Metrics | 144.4 us | 1.16 us | 1.08 us | 0.4883 | 2.92 KB |
-| GetRequestForAspNetCoreApp | Traces, Metrics | 163.0 us | 1.60 us | 1.49 us | 0.7324 | 3.63 KB |
-
-Allocation details for .NET 7:
-
-// Traces
-* Activity creation + `Activity.Start()` = 416 B
-* Casting of the struct `Microsoft.Extensions.Primitives.StringValues` to `IEnumerable` by `HttpRequestHeaderValuesGetter`
- - `TraceContextPropagator.Extract` = 24 B
- - `BaggageContextPropagator.Extract` = 24 B
-* String creation for `HttpRequest.HostString.Host` = 40 B
-* `Activity.TagsLinkedList` (this is allocated on the first Activity.SetTag call) = 40 B
-* Boxing of `Port` number when adding it as a tag = 24 B
-* String creation in `GetUri` method for adding the http url tag = 66 B
-* Setting `Baggage` (Setting AsyncLocal values causes allocation)
- - `BaggageHolder` creation = 24 B
- - `System.Threading.AsyncLocalValueMap.TwoElementAsyncLocalValueMap` = 48 B
- - `System.Threading.ExecutionContext` = 40 B
-* `DiagNode>`
- - This is allocated eight times for the eight tags that are added = 8 * 40 = 320 B
-* `Activity.Stop()` trying to set `Activity.Current` (This happens because of setting another AsyncLocal variable which is `Baggage`
- - System.Threading.AsyncLocalValueMap.OneElementAsyncLocalValueMap = 32 B
- - System.Threading.ExecutionContext = 40 B
-
-Baseline = 2.45 KB
-With Traces = 2.45 + (1138 / 1024) = 2.45 + 1.12 = 3.57 KB
-
-
-// Metrics
-* Activity creation + `Activity.Start()` = 416 B
-* Boxing of `Port` number when adding it as a tag = 24 B
-* String creation for `HttpRequest.HostString.Host` = 40 B
-
-Baseline = 2.45 KB
-With Metrics = 2.45 + (416 + 40 + 24) / 1024 = 2.45 + 0.47 = 2.92 KB
-
-// With Traces and Metrics
-
-Baseline = 2.45 KB
-With Traces and Metrics = Baseline + With Traces + (With Metrics - (Activity creation + `Acitivity.Stop()`)) (they use the same activity)
- = 2.45 + (1138 + 64) / 1024 = 2.45 + 1.17 = ~3.63KB
-*/
-
-namespace OpenTelemetry.Instrumentation.AspNetCore.Benchmark.Instrumentation;
-
-public class AspNetCoreInstrumentationBenchmarks
-{
- private HttpClient? httpClient;
- private WebApplication? app;
- private TracerProvider? tracerProvider;
- private MeterProvider? meterProvider;
-
- [Flags]
- public enum EnableInstrumentationOption
- {
- ///
- /// Instrumentation is not enabled for any signal.
- ///
- None = 0,
-
- ///
- /// Instrumentation is enabled only for Traces.
- ///
- Traces = 1,
-
- ///
- /// Instrumentation is enabled only for Metrics.
- ///
- Metrics = 2,
- }
-
- [Params(EnableInstrumentationOption.None, EnableInstrumentationOption.Traces, EnableInstrumentationOption.Metrics, EnableInstrumentationOption.Traces | EnableInstrumentationOption.Metrics)]
- public EnableInstrumentationOption EnableInstrumentation { get; set; }
-
- [GlobalSetup(Target = nameof(GetRequestForAspNetCoreApp))]
- public void GetRequestForAspNetCoreAppGlobalSetup()
- {
- if (this.EnableInstrumentation == EnableInstrumentationOption.None)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Traces)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- this.tracerProvider = Sdk.CreateTracerProviderBuilder()
- .AddAspNetCoreInstrumentation()
- .Build();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Metrics)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- this.meterProvider = Sdk.CreateMeterProviderBuilder()
- .AddAspNetCoreInstrumentation()
- .Build();
- }
- else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
- this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Metrics))
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- this.tracerProvider = Sdk.CreateTracerProviderBuilder()
- .AddAspNetCoreInstrumentation()
- .Build();
-
- this.meterProvider = Sdk.CreateMeterProviderBuilder()
- .AddAspNetCoreInstrumentation()
- .Build();
- }
- }
-
- [GlobalCleanup(Target = nameof(GetRequestForAspNetCoreApp))]
- public async Task GetRequestForAspNetCoreAppGlobalCleanup()
- {
- if (this.EnableInstrumentation == EnableInstrumentationOption.None)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Traces)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.tracerProvider?.Dispose();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Metrics)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.meterProvider?.Dispose();
- }
- else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
- this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Metrics))
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.meterProvider?.Dispose();
- }
- }
-
- [Benchmark]
- public async Task GetRequestForAspNetCoreApp()
- {
- var httpResponse = await this.httpClient!.GetAsync(new Uri("http://localhost:5000")).ConfigureAwait(false);
- httpResponse.EnsureSuccessStatusCode();
- }
-
- private void StartWebApplication()
- {
- var builder = WebApplication.CreateBuilder();
- builder.Logging.ClearProviders();
- var app = builder.Build();
- app.MapGet("/", async context => await context.Response.WriteAsync($"Hello World!"));
- app.RunAsync();
-
- this.app = app;
- }
-}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationNewBenchmarks.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationNewBenchmarks.cs
deleted file mode 100644
index 5e42243f74..0000000000
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Instrumentation/AspNetCoreInstrumentationNewBenchmarks.cs
+++ /dev/null
@@ -1,222 +0,0 @@
-// Copyright The OpenTelemetry Authors
-// SPDX-License-Identifier: Apache-2.0
-
-using BenchmarkDotNet.Attributes;
-using Microsoft.AspNetCore.Builder;
-using Microsoft.AspNetCore.Http;
-using Microsoft.Extensions.Configuration;
-using Microsoft.Extensions.DependencyInjection;
-using Microsoft.Extensions.Logging;
-using OpenTelemetry.Metrics;
-using OpenTelemetry.Trace;
-
-/*
-// * Summary *
-
-BenchmarkDotNet=v0.13.5, OS=Windows 11 (10.0.22621.1992/22H2/2022Update/SunValley2), VM=Hyper-V
-AMD EPYC 7763, 1 CPU, 16 logical and 8 physical cores
-.NET SDK=7.0.306
- [Host] : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2
- DefaultJob : .NET 7.0.9 (7.0.923.32018), X64 RyuJIT AVX2
-
-
-| Method | EnableInstrumentation | Mean | Error | StdDev | Allocated |
-|--------------------------- |---------------------- |---------:|--------:|--------:|----------:|
-| GetRequestForAspNetCoreApp | None | 150.7 us | 1.68 us | 1.57 us | 2.45 KB |
-| GetRequestForAspNetCoreApp | Traces | 156.6 us | 3.12 us | 6.37 us | 3.46 KB |
-| GetRequestForAspNetCoreApp | Metrics | 148.8 us | 2.87 us | 2.69 us | 2.92 KB |
-| GetRequestForAspNetCoreApp | Traces, Metrics | 164.0 us | 3.19 us | 6.22 us | 3.52 KB |
-
-Allocation details for .NET 7:
-
-// Traces
-* Activity creation + `Activity.Start()` = 416 B
-* Casting of the struct `Microsoft.Extensions.Primitives.StringValues` to `IEnumerable` by `HttpRequestHeaderValuesGetter`
- - `TraceContextPropagator.Extract` = 24 B
- - `BaggageContextPropagator.Extract` = 24 B
-* String creation for `HttpRequest.HostString.Host` = 40 B
-* `Activity.TagsLinkedList` (this is allocated on the first Activity.SetTag call) = 40 B
-* Boxing of `Port` number when adding it as a tag = 24 B
-* Setting `Baggage` (Setting AsyncLocal values causes allocation)
- - `BaggageHolder` creation = 24 B
- - `System.Threading.AsyncLocalValueMap.TwoElementAsyncLocalValueMap` = 48 B
- - `System.Threading.ExecutionContext` = 40 B
-* `DiagNode>`
- - This is allocated seven times for the seven (eight if query string is available) tags that are added = 7 * 40 = 280 B
-* `Activity.Stop()` trying to set `Activity.Current` (This happens because of setting another AsyncLocal variable which is `Baggage`
- - System.Threading.AsyncLocalValueMap.OneElementAsyncLocalValueMap = 32 B
- - System.Threading.ExecutionContext = 40 B
-
-Baseline = 2.45 KB
-With Traces = 2.45 + (1032 / 1024) = 2.45 + 1.01 = 3.46 KB
-
-
-// Metrics
-* Activity creation + `Activity.Start()` = 416 B
-* Boxing of `Port` number when adding it as a tag = 24 B
-* String creation for `HttpRequest.HostString.Host` = 40 B
-
-Baseline = 2.45 KB
-With Metrics = 2.45 + (416 + 40 + 24) / 1024 = 2.45 + 0.47 = 2.92 KB
-
-// With Traces and Metrics
-
-Baseline = 2.45 KB
-With Traces and Metrics = Baseline + With Traces + (With Metrics - (Activity creation + `Acitivity.Stop()`)) (they use the same activity)
- = 2.45 + (1032 + 64) / 1024 = 2.45 + 1.07 = ~3.52KB
-*/
-namespace OpenTelemetry.Instrumentation.AspNetCore.Benchmarks.Instrumentation;
-
-public class AspNetCoreInstrumentationNewBenchmarks
-{
- private HttpClient? httpClient;
- private WebApplication? app;
- private TracerProvider? tracerProvider;
- private MeterProvider? meterProvider;
-
- [Flags]
- public enum EnableInstrumentationOption
- {
- ///
- /// Instrumentation is not enabled for any signal.
- ///
- None = 0,
-
- ///
- /// Instrumentation is enabled only for Traces.
- ///
- Traces = 1,
-
- ///
- /// Instrumentation is enabled only for Metrics.
- ///
- Metrics = 2,
- }
-
- [Params(EnableInstrumentationOption.None, EnableInstrumentationOption.Traces, EnableInstrumentationOption.Metrics, EnableInstrumentationOption.Traces | EnableInstrumentationOption.Metrics)]
- public EnableInstrumentationOption EnableInstrumentation { get; set; }
-
- [GlobalSetup(Target = nameof(GetRequestForAspNetCoreApp))]
- public void GetRequestForAspNetCoreAppGlobalSetup()
- {
- KeyValuePair[] config = [];
- var configuration = new ConfigurationBuilder()
- .AddInMemoryCollection(config)
- .Build();
-
- if (this.EnableInstrumentation == EnableInstrumentationOption.None)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Traces)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- this.tracerProvider = Sdk.CreateTracerProviderBuilder()
- .ConfigureServices(services => services.AddSingleton(configuration))
- .AddAspNetCoreInstrumentation()
- .Build();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Metrics)
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- var exportedItems = new List();
- this.meterProvider = Sdk.CreateMeterProviderBuilder()
- .ConfigureServices(services => services.AddSingleton(configuration))
- .AddAspNetCoreInstrumentation()
- .AddInMemoryExporter(exportedItems, metricReaderOptions =>
- {
- metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
- })
- .Build();
- }
- else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
- this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Metrics))
- {
- this.StartWebApplication();
- this.httpClient = new HttpClient();
-
- this.tracerProvider = Sdk.CreateTracerProviderBuilder()
- .ConfigureServices(services => services.AddSingleton(configuration))
- .AddAspNetCoreInstrumentation()
- .Build();
-
- var exportedItems = new List();
- this.meterProvider = Sdk.CreateMeterProviderBuilder()
- .ConfigureServices(services => services.AddSingleton(configuration))
- .AddAspNetCoreInstrumentation()
- .AddInMemoryExporter(exportedItems, metricReaderOptions =>
- {
- metricReaderOptions.PeriodicExportingMetricReaderOptions.ExportIntervalMilliseconds = 1000;
- })
- .Build();
- }
- }
-
- [GlobalCleanup(Target = nameof(GetRequestForAspNetCoreApp))]
- public async Task GetRequestForAspNetCoreAppGlobalCleanup()
- {
- if (this.EnableInstrumentation == EnableInstrumentationOption.None)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Traces)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.tracerProvider?.Dispose();
- }
- else if (this.EnableInstrumentation == EnableInstrumentationOption.Metrics)
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.meterProvider?.Dispose();
- }
- else if (this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Traces) &&
- this.EnableInstrumentation.HasFlag(EnableInstrumentationOption.Metrics))
- {
- this.httpClient?.Dispose();
- if (this.app != null)
- {
- await this.app.DisposeAsync();
- }
-
- this.tracerProvider?.Dispose();
- this.meterProvider?.Dispose();
- }
- }
-
- [Benchmark]
- public async Task GetRequestForAspNetCoreApp()
- {
- var httpResponse = await this.httpClient!.GetAsync(new Uri("http://localhost:5000")).ConfigureAwait(false);
- httpResponse.EnsureSuccessStatusCode();
- }
-
- private void StartWebApplication()
- {
- var builder = WebApplication.CreateBuilder();
- builder.Logging.ClearProviders();
- var app = builder.Build();
- app.MapGet("/", async context => await context.Response.WriteAsync($"Hello World!"));
- app.RunAsync();
-
- this.app = app;
- }
-}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks.csproj b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks.csproj
index ea0aa66c99..ba091755cd 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks.csproj
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks.csproj
@@ -5,12 +5,21 @@
Exe
+
+
+
+
+
+
+
+
+
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Program.cs b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Program.cs
index 5e1c1a3d17..9be0226363 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Program.cs
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Program.cs
@@ -2,10 +2,6 @@
// SPDX-License-Identifier: Apache-2.0
using BenchmarkDotNet.Running;
+using OpenTelemetry.Instrumentation.AspNetCore.Benchmarks;
-namespace OpenTelemetry.Instrumentation.AspNetCore.Benchmarks;
-
-internal class Program
-{
- private static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
-}
+BenchmarkSwitcher.FromAssembly(typeof(AspNetCoreBenchmarks).Assembly).Run(args);
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Proto/greet.proto b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Proto/greet.proto
new file mode 100644
index 0000000000..c9ab263f18
--- /dev/null
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/Proto/greet.proto
@@ -0,0 +1,29 @@
+// Copyright 2019 The gRPC Authors
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+syntax = "proto3";
+
+package greet;
+
+service Greeter {
+ rpc SayHello (HelloRequest) returns (HelloReply);
+}
+
+message HelloRequest {
+ string name = 1;
+}
+
+message HelloReply {
+ string message = 1;
+}
diff --git a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/README.md b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/README.md
index 797799c290..e08fd21f38 100644
--- a/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/README.md
+++ b/test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks/README.md
@@ -1,11 +1,8 @@
# OpenTelemetry ASP.NET Core Instrumentation Benchmarks
-Navigate to `./test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks` directory
-and run the following command:
+Navigate to the `./test/OpenTelemetry.Instrumentation.AspNetCore.Benchmarks`
+directory and run the following command to run all of the benchmarks:
```sh
-dotnet run -c Release -f net10.0 -- -m
-``
-
-Then choose the benchmark class that you want to run by entering the required
-option number from the list of options shown on the Console window.
+dotnet run --configuration Release --framework net10.0 -- --filter "*"
+```