feat(collector)!: complete the OTel AutoInstrumentation 4.0.0 cutover - #458
Conversation
Qyl.OpenTelemetry.AutoInstrumentation no longer intercepts WebApplicationBuilder.Build() (it moved its ASP.NET Core middleware to an IStartupFilter). The cross-generator coordination that let qyl's ServiceDefaults Build() interceptor coexist with the package's Build() interceptor is now dead, so remove it: - GeneratorPipelineHelpers: drop QylInterceptedAspNetCoreTypeName + IsOtelAutoInstrumentationReferenced. - ServiceDefaultsSourceGenerator: drop the otelAutoInstrumentationAvailable pipeline stage, the BuilderInterceptorInput field it fed, and the QYL0138 fail-fast diagnostic (there is no longer a package whose absence would silently drop OTel middleware). - AnalyzerReleases.Unshipped.md: remove the QYL0138 row to match the deleted descriptor (fixes RS2002). Generator project builds green (0 warnings/0 errors). Pairs with the AutoInstrumentation-side cut. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…4.0.0 cutover Pairs with the generator-side cut (drop the Build() compose + QYL0138) to finish the lockstep migration to 4.0.0, which removed QylInterceptedAspNetCore.Build and injects the ASP.NET Core server-span middleware via IStartupFilter instead. - Directory.Packages.props: pin 3.1.2 -> 4.0.0 - qyl.collector.csproj: drop the QylAutoInstrumentationInterceptWebApplicationBuilderBuild opt-out knob (no longer needed — the OTel generator no longer intercepts Build()). - Program.cs: builder.Services.AddQylAspNetCoreInstrumentation() so the collector keeps its server-request span (the Build() interceptor that used to wire it is gone). Verified: `dotnet build services/qyl.collector -c Release` succeeds 0/0 against the published 4.0.0 (ServiceDefaults owns Build() alone -> no CS9153). The unrelated NU1903 Microsoft.OpenApi advisory (transitive via Microsoft.AspNetCore.OpenApi) is orthogonal to this change and blocks any collector build repo-wide until deps are refreshed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout. (2)
🧰 Additional context used📓 Path-based instructions (4)**/*.{cs,csx,csproj,props}📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**/Directory.Packages.props📄 CodeRabbit inference engine (.github/copilot-instructions.md)
Files:
**⚙️ CodeRabbit configuration file
Files:
**/*.props⚙️ CodeRabbit configuration file
Files:
🔇 Additional comments (2)
Summary by CodeRabbit
WalkthroughCentral package management was updated in ChangesCentral package updates
Estimated code review effort: 1 (Trivial) | ~2 minutes Possibly related PRs
Suggested labels: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error)
✅ Passed checks (7 passed)
Comment |
There was a problem hiding this comment.
Pull request overview
Completes the in-repo portion of the migration to Qyl.OpenTelemetry.AutoInstrumentation 4.0.0, removing the previous WebApplicationBuilder.Build() interception composition point and explicitly registering the ASP.NET Core server-span middleware via DI.
Changes:
- Bumps
Qyl.OpenTelemetry.AutoInstrumentationfrom3.1.2to4.0.0in central package management. - Removes the collector opt-out property that previously prevented Build() interceptor collisions (CS9153).
- Updates the ServiceDefaults source generator to emit a plain
builder.Build()interceptor and drops theQYL0138fail-fast path that required the OTel package.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
Directory.Packages.props |
Pins Qyl.OpenTelemetry.AutoInstrumentation to 4.0.0. |
services/qyl.collector/qyl.collector.csproj |
Removes the now-obsolete Build() interception opt-out property. |
services/qyl.collector/Program.cs |
Explicitly registers AddQylAspNetCoreInstrumentation() for server-request spans. |
internal/qyl.instrumentation.generators/ServiceDefaultsSourceGenerator.cs |
Removes QYL0138 enforcement and emits builder.Build() directly. |
internal/qyl.instrumentation.generators/GeneratorPipelineHelpers.cs |
Deletes OTel-reference detection helpers no longer used by the generator pipeline. |
internal/qyl.instrumentation.generators/AnalyzerReleases/AnalyzerReleases.Unshipped.md |
Removes the unshipped QYL0138 entry. |
| var buildExpression = $"global::{GeneratorPipelineHelpers.QylInterceptedAspNetCoreTypeName}.Build(builder)"; | ||
|
|
||
| // Wire qyl ServiceDefaults (conventions, generated service + health-check registration, and | ||
| // default endpoints) at the single WebApplicationBuilder.Build() call site, then build the host. |
…c-g5wc) Microsoft.AspNetCore.OpenApi pulls Microsoft.OpenApi 2.0.0 transitively, which a newly-live advisory (GHSA-v5pm-xwqc-g5wc, high) flags — failing the Dependency Audit + Backend builds repo-wide (main was last green 2026-06-30, before the advisory). 2.7.5 is the first patched 2.x. Collector runs with EnableOpenApi=false, so this is not functionally exercised — it only lifts the transitive off the vulnerable range. Verified: collector Release builds 0/0 with NuGetAudit ON. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Completes the qyl side of the
Qyl.OpenTelemetry.AutoInstrumentation4.0.0 migration(external PR ANcpLua/Qyl.OpenTelemetry.AutoInstrumentation#20, published + indexed on nuget.org).
4.0.0 removed
QylInterceptedAspNetCore.Buildand injects the ASP.NET Core server-spanmiddleware via
IStartupFilterinstead of aBuild()interceptor.Includes the fleet's generator-half commit (
3382f960) + the consumer half:Generator half (fleet,
3382f960)GeneratorPipelineHelpers: dropQylInterceptedAspNetCoreTypeName+IsOtelAutoInstrumentationReferencedServiceDefaultsSourceGenerator: drop theotelAutoInstrumentationAvailablestage + the QYL0138 fail-fast → emit plainbuilder.Build()AnalyzerReleases.Unshipped.md: drop the QYL0138 row (RS2002)Consumer half (this)
Directory.Packages.props: pin3.1.2 → 4.0.0qyl.collector.csproj: drop theQylAutoInstrumentationInterceptWebApplicationBuilderBuildopt-out knob (the OTel generator no longer interceptsBuild(), so there's nothing to yield)Program.cs:builder.Services.AddQylAspNetCoreInstrumentation()— restores the server-request span the removedBuild()interceptor used to wireVerification
dotnet build services/qyl.collector -c Release→ 0 warnings / 0 errors against published 4.0.0. ServiceDefaults ownsBuild()alone now → no CS9153.CI's collector build will red-fail on
NU1903— a live advisory on transitiveMicrosoft.OpenApi 2.0.0(viaMicrosoft.AspNetCore.OpenApi, a framework dep). It's unrelated to this change (4.0.0 has no OpenApi dependency) and fails any collector build repo-wide until deps are refreshed. Verified clean with the audit isolated.🤖 Generated with Claude Code