diff --git a/tracer/build/_build/Build.cs b/tracer/build/_build/Build.cs index 4d85319b03bb..a9c8e8c11326 100644 --- a/tracer/build/_build/Build.cs +++ b/tracer/build/_build/Build.cs @@ -573,20 +573,32 @@ void DeleteReparsePoints(string path) .Description("Runs the Benchmarks project") .Executes(() => { - var benchmarkProjectsWithSettings = new Tuple>[] { - new(Projects.BenchmarksTrace, s => s), + var benchmarkProjectsWithSettings = new List<(string Project, Func Configure)> + { + (Projects.BenchmarksTrace, s => s), // new(Projects.BenchmarksOpenTelemetryApi, s => s), - new(Projects.BenchmarksOpenTelemetryInstrumentedApi, + (Projects.BenchmarksOpenTelemetryInstrumentedApi, s => s.SetProcessEnvironmentVariable("DD_TRACE_OTEL_ENABLED", "true") .SetProcessEnvironmentVariable("DD_INSTRUMENTATION_TELEMETRY_ENABLED", "false") .SetProcessEnvironmentVariable("DD_INTERNAL_AGENT_STANDALONE_MODE_ENABLED", "true") .SetProcessEnvironmentVariable("DD_CIVISIBILITY_FORCE_AGENT_EVP_PROXY", "V4")), }; + var isPr = int.TryParse(Environment.GetEnvironmentVariable("PR_NUMBER"), out var _); + // We don't run the base Otel benchmarks on PRs as nothing we do should change them. + // We _do_ run them on master, so we have up-to-date comparison data + // We can't easily use the benchmark "category" approach that we use below, because the BenchmarksOpenTelemetryApi + // project shares the same tests as BenchmarksOpenTelemetryInstrumentedApi. + if (!isPr) + { + benchmarkProjectsWithSettings.Add((Projects.BenchmarksOpenTelemetryApi, s => s)); + } + + foreach (var tuple in benchmarkProjectsWithSettings) { - var benchmarkProjectName = tuple.Item1; - var configureDotNetRunSettings = tuple.Item2; + var benchmarkProjectName = tuple.Project; + var configureDotNetRunSettings = tuple.Configure; var benchmarksProject = Solution.GetProject(benchmarkProjectName); var resultsDirectory = benchmarksProject.Directory / "BenchmarkDotNet.Artifacts" / "results"; @@ -608,7 +620,6 @@ void DeleteReparsePoints(string path) }; // We could choose to not run asm on non-ASM PRs (for example) but for now we just run all categories - var isPr = int.TryParse(Environment.GetEnvironmentVariable("PR_NUMBER"), out var _); var categories = (BenchmarkCategory, isPr) switch { ({ Length: > 0 }, _) => BenchmarkCategory,