Skip to content

otel#12

Closed
marklauter wants to merge 4 commits into
lauterm/otelfrom
main
Closed

otel#12
marklauter wants to merge 4 commits into
lauterm/otelfrom
main

Conversation

@marklauter

Copy link
Copy Markdown
Owner

No description provided.

marklauter and others added 4 commits June 14, 2026 01:23
…rage to > 95% (#8)

* Add Plumber.Diagnostics (OpenTelemetry) and rename Serilog extension

Migrate the stale plumber.opentelemetry.extensions repo into the monorepo as
Plumber.Diagnostics, modernized to .NET 10 / C# 14 and the repo conventions:

- Library instruments via BCL ActivitySource/Meter with no OpenTelemetry SDK
  dependency; ctor-injected IOptions; TimeProvider-backed timing via
  RequestContext.Elapsed; BCL Activity.AddException for exception recording.
- API: UseRequestTracing / UseRequestMetrics / UseRequestDiagnostics,
  AddPlumberDiagnostics, with PlumberDiagnostics exposing the source/meter names.
- 30 tests via BCL ActivityListener/MeterListener (100% line, 91% branch,
  100% method); arch-test class; serial execution for global diagnostic state.
- Folded into Sample.Cli with host-free SDK console exporters.
- Wired into Plumber.slnx, the publish workflow, and README.

Rename Plumber.Serilog.Extensions -> Plumber.Serilog (assembly/namespace),
keeping the published PackageId MSL.Plumber.Serilog.Extensions.

Drop the redundant Microsoft.Extensions.Logging SimpleConsole from Sample.Cli;
keep AddLogging so ILogger<T> still resolves, with Serilog as the sole sink.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Point README Diagnostics link at the renamed wiki page

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: upload coverage for all Plumber.* test projects

The coverage artifact upload only listed Plumber.Tests and
Sample.Cli.Tests. Add the missing Plumber.Testing.Tests,
Plumber.Diagnostics.Tests, and Plumber.Serilog.Tests cobertura
reports so coverage is captured for every Plumber.* library.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Treat cancellation as a non-error in the diagnostics middleware (#3, #4)

OperationCanceledException — how Plumber surfaces both caller cancellation and
a pipeline timeout to the middleware — is an expected outcome, not a defect:

- tracing: leave the span Unset, record no exception event;
- metrics: keep it out of plumber.requests.errors and the duration histogram,
  and skip the RecordCustomMetrics hook (resolved outcomes only);
- it still counts in plumber.requests.count as an attempt.

ThrowOnException still governs propagation. RecordCustomMetrics moves off the
blanket finally into the success and genuine-error paths so the hook never sees
a cancellation as success=false.

Coverage to 100% line/branch/method (added enrichment-on-cancel/error and
null-response tests); diagnostics threshold raised 91->100.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Untrack draft review doc committed by mistake

docs/publish-workflow-remediation.md is an in-progress review artifact (like
docs/otel-migration-findings.md) and was swept into the previous commit by
git add -A. Remove it from tracking; the working file stays on disk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: harden publish workflow (gate on Release, metadata-driven pack)

Implements items 1-5 of the publish-workflow remediation plan:

- Gate job now builds and tests `-c Release`, matching the shipped
  configuration instead of validating Debug.
- Replace the four hand-maintained pack steps with a single
  `dotnet pack Plumber.slnx`; mark Sample.Cli IsPackable=false so the
  solution pack emits only the four MSL.Plumber.* packages.
- Validate the release tag resolves to a semver before pack/push.
- Add a concurrency guard keyed on the release tag (no cancel-in-progress).
- Pin the SDK via global.json (10.0.100, rollForward latestFeature).

Trusted Publishing (OIDC) and job-setup de-duplication are deferred.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: extract shared setup-dotnet composite action

Implements item 6 of the remediation plan. Replace the duplicated
setup-dotnet + NuGet cache steps across both workflows (four jobs) with
a local composite action referenced as ./.github/actions/setup-dotnet.
checkout stays per-job since a local composite can only resolve after the
repo is checked out.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: trigger tests on composite action and global.json changes

The tests workflow now depends on the setup-dotnet composite action and
the SDK pin in global.json, but the path filters gated only on the
workflow file itself. Add both so changes to either re-run the suite.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: fix readme casing, add CI determinism flag and publish dry-run

Addresses three follow-up findings:

- Pack the readme as README.md (was readme.md) in all four packable
  projects. The publish job packs on case-sensitive ubuntu, where the
  lowercase path would fail with NU5039 at release time; it only passed
  locally on case-insensitive Windows.
- Set ContinuousIntegrationBuild=true in CI (gated on GITHUB_ACTIONS) for
  reproducible builds and normalized SourceLink paths in packed binaries.
- Add a workflow_dispatch trigger to the publish workflow with a version
  input; guard the nuget push with `if: github.event_name == 'release'`
  so manual runs build/test/pack/upload without publishing.

The paths-filter vs. required-status-check question is documented as open
in the remediation plan; it depends on branch-protection settings.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Sample.Cli: in-memory OTel exporter with a summary, not a console dump (#10, #11)

#10: swap the OpenTelemetry console exporter for the in-memory exporter and
print a compact Telemetry.Summarize() line after the run, so the demo console
shows the report plus a one-line confirmation that span/metric collection
worked, instead of interleaved exporter dumps.

#11: comment the inline timing delegate to distinguish its role (it feeds the
printed report payload) from the OTel span duration and the Serilog elapsed.

Tests: TelemetrySummaryReflectsAPipelineRun drives the pipeline through the
in-memory exporters; the assembly runs serially to avoid cross-test telemetry
leakage. Sample.Cli branch coverage 38->47.5%, floor raised 38->45.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* docs: correct remediation plan status (items 1-9 implemented)

The status line still read "items 1-6"; items 7-9 are also done and
item 10 is open pending a branch-protection decision.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* better tests

* nuget: sharpen package titles, descriptions, and tags

Improve discoverability and clarity across the four publishable packages
without touching PackageIds (upgrade continuity preserved):

- Plumber: lead the title with the ASP.NET Core analogy and concrete
  surfaces (console/worker/serverless); add the Microsoft.Extensions
  familiarity hook; broaden tags (serverless, aws-lambda, azure-functions,
  background-service, di, cancellation).
- Plumber.Testing: promote the WebApplicationFactory analogy into the title.
- Plumber.Diagnostics: front-load the no-OpenTelemetry-SDK-dependency
  differentiator and name export backends; add distributed-tracing,
  activitysource, meter, instrumentation, monitoring tags.
- Plumber.Serilog.Extensions: surface trace correlation (TraceId/SpanId)
  and add diagnostic-context, observability, trace-correlation tags.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* revert: keep Plumber.Serilog.Extensions namespace and assembly

Undo the rename of the Serilog package from Plumber.Serilog.Extensions to
Plumber.Serilog. The PackageId was always MSL.Plumber.Serilog.Extensions, so
the rename changed only the assembly name and namespace — a source- and
binary-breaking change for every existing consumer (their
`using Plumber.Serilog.Extensions;` would break) for no functional benefit.

Restores the project and test directory names, assembly, and namespace to
Plumber.Serilog.Extensions, and updates the solution, sample, test project,
and CI coverage path to match. The release is now a non-breaking minor bump
(5.1.0): the only new public surface is the additive Plumber.Diagnostics package.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* ci: pass nuget key via env, pin SDK install via global.json

- dotnet.publish.yml: pass NUGET_API_KEY through `env:` and reference it as
  "$NUGET_API_KEY" instead of interpolating the secret into the run command.
- setup-dotnet action: install the SDK via global-json-file so global.json is
  the single source of truth (was dotnet-version: 10.0.x, which the action
  does not reconcile against global.json).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Bumps Microsoft.NET.Test.Sdk from 18.6.0 to 18.7.0

---
updated-dependencies:
- dependency-name: Microsoft.NET.Test.Sdk
  dependency-version: 18.7.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: nuget-minor-and-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps the actions group with 1 update: [actions/checkout](https://github.com/actions/checkout).


Updates `actions/checkout` from 6 to 7
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
- Point the migration note at all earlier versions and note v5 is
  non-breaking.
- Rewrite figurative lines into plain Microsoft-style prose; keep the
  MSL Armory branding.

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@marklauter

Copy link
Copy Markdown
Owner Author

oops

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant