Update diagnostic source and other related packages - #2806
Conversation
🤖 GitHub commentsJust comment with:
|
Elastic Docs Style Checker (Vale)Summary: 1 suggestion found 💡 Suggestions (1): Optional style improvements. Apply when helpful.
The Vale linter checks documentation changes against the Elastic Docs style guide. To use Vale locally or report issues, refer to Elastic style guide for Vale. |
🔍 Preview links for changed docs |
646abad to
3393c02
Compare
3393c02 to
310f0ff
Compare
There was a problem hiding this comment.
🟡 Changes recommended
There are a few correctness/robustness issues in the updated code and config (notably a malformed log message and a potentially inconsistent binding redirect entry) that should be addressed before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Updates the agent and test suite to support newer .NET runtimes (notably net10.0) while tightening dependency/versioning rules for “platform packages” (DiagnosticSource and related) to avoid runtime loading issues (startup hook / profiler) and .NET Framework binding problems.
Changes:
- Add net10.0 target frameworks across core libraries, integrations, profiler components, and tests; update CI bootstrap to install .NET 9/10 SDKs.
- Introduce a pack-time verification step to enforce “platform package parity” rules described in
Directory.Packages.props. - Stabilize tests under newer runtimes by explicitly disabling the OpenTelemetry bridge in affected assertions and adding/adjusting tests for net10 behavior.
File summaries
| File | Description |
|---|---|
| test/startuphook/Elastic.Apm.StartupHook.Tests/StartupHookTests.cs | Extend startup hook runtime/DiagnosticSource test matrix to include .NET 10 and clarify intent. |
| test/startuphook/Elastic.Apm.StartupHook.Tests/DotnetProject.cs | Generate per-sample global.json from repository SDK settings to avoid SDK/task assembly mismatches. |
| test/startuphook/Elastic.Apm.StartupHook.Sample/Elastic.Apm.StartupHook.Sample.csproj | Add net10.0 target and suppress ASP.NET Core 10 WebHost obsoletion warning for continued coverage. |
| test/profiler/Elastic.Apm.Profiler.Managed.Tests/ExcludeTests.cs | Add net10.0 coverage and relax span-count assertion for net10 runtime behavior. |
| test/profiler/Elastic.Apm.Profiler.Managed.Tests/BasicTests.cs | Add a dedicated net10 managed-profiler load/instrumentation test. |
| test/profiler/applications/SqliteSample/SqliteSample.csproj | Add net10.0 target and suppress a NuGet audit advisory until upstream packages ship a fix. |
| test/opentelemetry/Elastic.Apm.OpenTelemetry.Tests/Elastic.Apm.OpenTelemetry.Tests.csproj | Add net10.0 to the OpenTelemetry test target frameworks. |
| test/integrations/applications/SampleAspNetCoreApp/Controllers/HomeController.cs | Minor null-check simplifications using null-conditional assignment. |
| test/instrumentations/Elastic.Clients.Elasticsearch.Tests/ElasticsearchTestFixture.cs | Remove an unreachable/irrelevant null check after new. |
| test/iis/Elastic.Apm.AspNetFullFramework.Tests/Elastic.Apm.AspNetFullFramework.Tests.csproj | Add/adjust AngleSharp dependencies for IIS/full-framework tests. |
| test/iis/Elastic.Apm.AspNetFullFramework.Tests/CaptureUserTests.cs | Update AngleSharp usage and modernize assertions/constructor pattern. |
| test/iis/AspNetFullFrameworkSampleApp/Web.config | Update binding redirects to match new platform-package dependency line. |
| test/Elastic.Apm.Tests/UnsampledTransactionTests.cs | Disable OTel bridge in tests whose assertions depend on “no payload sent.” |
| test/Elastic.Apm.Tests/SpanCompressionTests.cs | Disable OTel bridge to prevent runtime experimental ActivitySources from breaking counts. |
| test/Elastic.Apm.Tests/ServerCertificateTests.cs | Update certificate loading for NET9+ and improve timeout diagnostics; disable OTel bridge. |
| test/Elastic.Apm.Tests/LoggerTests.cs | Disable OTel bridge to prevent parallel-test Activity noise from altering log counts. |
| test/Elastic.Apm.Tests/HttpDiagnosticListenerTests.cs | Warm up HttpClient handler for net10 callstack behavior and add a documenting regression test. |
| test/Elastic.Apm.Tests/Features/AgentFeaturesProviderTests.cs | Avoid static-cache race by testing Create(...) instead of cached Get(...). |
| test/Elastic.Apm.Tests/Elastic.Apm.Tests.csproj | Add net10.0 to the main unit test project target frameworks. |
| test/Elastic.Apm.Tests/ConstructorTests.cs | Align test collection usage to prevent cross-test scope interference. |
| test/Elastic.Apm.Tests/ActivityIntegrationTests.cs | Make sampling test resilient to parallel ActivitySources and culture-specific formatting. |
| src/profiler/Elastic.Apm.Profiler.Managed/Elastic.Apm.Profiler.Managed.csproj | Add net10.0 target for managed profiler implementation. |
| src/profiler/Elastic.Apm.Profiler.Managed.Loader/Startup.NetCore.cs | Resolve managed-profiler directory for .NET 10 specifically. |
| src/profiler/Elastic.Apm.Profiler.Managed.Core/Elastic.Apm.Profiler.Managed.Core.csproj | Add net10.0 target for managed profiler core. |
| src/integrations/Elastic.Apm.NetCoreAll/Elastic.Apm.NetCoreAll.csproj | Add net10.0 target for the convenience integration package. |
| src/integrations/Elastic.Apm.Extensions.Logging/Elastic.Apm.Extensions.Logging.csproj | Add net10.0 target and net10-specific Microsoft.Extensions dependency pinning. |
| src/integrations/Elastic.Apm.Extensions.Hosting/Elastic.Apm.Extensions.Hosting.csproj | Add net10.0 target and net10-specific Microsoft.Extensions dependency pinning. |
| src/integrations/Elastic.Apm.AspNetFullFramework/HttpContextCurrentExecutionSegmentsContainer.cs | Minor null-check simplifications around HttpContext.Current. |
| src/integrations/Elastic.Apm.AspNetCore/Extensions/RequestExtensions.cs | Minor null-check simplifications around IHttpBodyControlFeature. |
| src/integrations/Elastic.Apm.AspNetCore/Elastic.Apm.AspNetCore.csproj | Add net10.0 target, adjust framework reference condition, and pin System.Text.Encodings.Web. |
| src/instrumentations/Elastic.Apm.EntityFrameworkCore/Elastic.Apm.EntityFrameworkCore.csproj | Add net10.0 target and adjust EFCore/platform dependency pinning. |
| src/Elastic.Apm/Model/Span.cs | Minor null-check simplification in compression buffer handling. |
| src/Elastic.Apm/Features/AgentFeaturesProvider.cs | Make feature-set initialization thread-safe; add Create(...) helper. |
| src/Elastic.Apm/Extensions/TransactionExtensions.cs | Minor null-check simplification around transaction.Context. |
| src/Elastic.Apm/Elastic.Apm.csproj | Add net10.0 target and update platform-package dependency strategy across TFMs (incl. .NET Framework). |
| src/Elastic.Apm/Config/ConfigurationLogger.cs | Log matched TFM for net10 builds. |
| src/Elastic.Apm/BackendComm/BackendCommUtils.cs | Use X509CertificateLoader on NET9+ for certificate loading. |
| src/Elastic.Apm.Specification/Elastic.Apm.Specification.csproj | Add missing net462 reference to System.Net.Http. |
| src/azure/Elastic.Apm.Azure.ServiceBus/Elastic.Apm.Azure.ServiceBus.csproj | Add net10.0 target. |
| src/azure/Elastic.Apm.Azure.Functions/Elastic.Apm.Azure.Functions.csproj | Add net10.0 target. |
| sample/ApiSamples/Program.cs | Adjust pragma restore placement. |
| global.json | Bump repository SDK to 10.0.100 with latestFeature roll-forward. |
| docs/reference/setup-asp-dot-net.md | Document required .NET Framework binding redirects for agent platform-package dependencies. |
| Directory.Packages.props | Introduce platform-package version-line rules, add net10/netfx version properties, update several package versions. |
| build/scripts/Targets.fs | Add a dedicated target for platform package verification. |
| build/scripts/Build.fs | Implement and run platform package parity verification during pack. |
| .github/workflows/bootstrap/action.yml | Install .NET 9 and .NET 10 SDKs in bootstrap action. |
Review details
- Files reviewed: 47/47 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
a46c9dd to
1306999
Compare
No description provided.