Skip to content

feat(logging): add structured strategy logs - #313

Merged
thomhurst merged 20 commits into
mainfrom
issue-223-logging
Aug 25, 2026
Merged

feat(logging): add structured strategy logs#313
thomhurst merged 20 commits into
mainfrom
issue-223-logging

Conversation

@thomhurst

Copy link
Copy Markdown
Owner

Closes #223.

Adds Kevlar.Extensions.Logging with stable structured ILogger events for retry, timeout, circuit state, hedge, fallback, rejection, and callback errors. Supports direct WithLogging decoration plus AddKevlarLogging for named, reloading, partitioned, and HttpClientFactory shields. HTTP fields redact query/fragment data; disabled levels skip formatting and remain allocation-free.

Also adds OpenTelemetry export coverage, package/API/docs integration, event throttling/scopes, manual circuit isolation logging, and callback/logger failure isolation.

Validation:

  • dotnet build Kevlar.slnx -c Release
  • Kevlar.Extensions.Logging.Tests: 19/19 on net8.0 and net10.0
  • Kevlar.IntegrationTests: 165/165
  • Kevlar.Tests: 1111/1111 on net10.0; pre-rebase 1081/1081 net8.0 and 1106/1106 net10.0
  • Kevlar.AllocationTests: 4/4 on net8.0 and net10.0
  • Kevlar.Chaos.Tests: 36/36 on net8.0 and net10.0
  • Kevlar.Analyzers.Tests: 87/87
  • API docs and Docusaurus builds
  • Verify-Packages.ps1: all package, SourceLink, determinism, consumer, trim/single-file, and analyzer checks
  • Verify-DocSnippets.ps1: 181 snippets on net8.0 and net10.0

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 011d95b7-d45a-40c5-a80d-e0e777caffc6


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1406507159

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs Outdated
Comment thread src/Kevlar/CallbackErrorKind.cs
Comment thread src/Kevlar/Strategies/CircuitBreaker/CircuitBreakerCore.cs Outdated

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1e6fa82863

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs
Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs Outdated
Comment thread src/Kevlar/Strategies/CircuitBreaker/CircuitBreakerCore.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/LoggingStrategy.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed all review findings and the docs sidebar collision. Validation: Release solution build; Kevlar.Extensions.Logging.Tests 22/22 on net8.0 and net10.0; Kevlar.Tests 1133/1133 net8.0 and 1158/1158 net10.0; allocations 4/4 both; Verify-Docs, Verify-ApiDocs, DocFX, and Docusaurus build clean. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bd28aef919

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs Outdated
Comment thread src/Kevlar/KevlarDiagnostics.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

Review fixes pushed in 526914e.

Validation:

  • dotnet build Kevlar.slnx -c Release — clean, 0 warnings/errors
  • Kevlar.Extensions.Logging.Tests net8.0/net10.0 — 24/24 each
  • Kevlar.Tests net8.0 — 1133/1133
  • Kevlar.Tests net10.0 — 1158/1158
  • Kevlar.IntegrationTests net10.0 — 166/166
  • pwsh scripts/Verify-Docs.ps1 — pass
  • npm run build in docs/ — pass
  • git diff --check origin/main...HEAD — pass

Also fixed the docs CI failure: unpublished logging-package NuGet URL now points to the checked-in logging guide.

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@thomhurst

Copy link
Copy Markdown
Owner Author

Follow-up 76baa6c closes both fresh findings. Release build: clean. Logging tests: 25/25 on net8.0 and net10.0. Core tests: 1134/1134 on net8.0 and 1165/1165 on net10.0. Integration: 166/166. Docs verification: pass. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 76baa6c61c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/KevlarLoggingServiceCollectionExtensions.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/ShieldLoggingExtensions.cs
@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 9ad1ef452a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs
Comment thread src/Kevlar.Extensions.Logging/ShieldLoggingExtensions.cs
Comment thread src/Kevlar.Extensions.Logging/LoggerMessages.cs
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed all review findings at 0b237bb.

Validation:

  • dotnet build Kevlar.slnx -c Release — pass, 0 warnings
  • Logging tests net8.0/net10.0 — 30/30 each
  • Core tests net8.0 — 1134/1134; net10.0 — 1165/1165
  • Integration tests — 166/166
  • Allocation tests net8.0/net10.0 — 4/4 each
  • pwsh scripts/Verify-Docs.ps1 — pass

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 0b237bba69

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Internal/ShieldDecoration.cs
Decorate request-selected shields, distinguish circuit rejections, meter logging callback failures, and prune collected circuit listeners.
Reuse DI logging rate-limit state, decorate direct HTTP request overrides, and attach logging telemetry when circuit breakers are appended later.
@thomhurst

Copy link
Copy Markdown
Owner Author

Composition-stamp finding fixed at da7d8eb after rebasing onto latest main.

Validation:

  • dotnet build Kevlar.slnx -c Release — pass, 0 warnings
  • Core tests net8.0 — 1151/1151; net10.0 — 1182/1182
  • Logging tests net8.0/net10.0 — 30/30 each

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da7d8ebacd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/ShieldExtensions.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

Partial-composition finding fixed at 8fa357f.

Validation:

  • dotnet build Kevlar.slnx -c Release — pass, 0 warnings
  • Core tests net8.0 — 1151/1151; net10.0 — 1182/1182
  • Logging tests net8.0/net10.0 — 30/30 each

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8fa357f3ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Http/ShieldHttpClientBuilderExtensions.cs
Comment thread src/Kevlar/ShieldExtensions.cs Outdated
Comment thread src/Kevlar/Strategies/Retry/RetryStrategy.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs
Decorate endpoint shields once, preserve outer transparent decorators through composition, defer disabled result boxing, and report successful circuit closure accurately.
Remove URI user-info from HTTP telemetry and select result capture using the event severity, logger state, and quota before materializing value results.
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed URI user-info redaction and severity-suppressed result boxing in 3cc3d74. Release build; core 1152/1183; integration 166; logging 36/36 both; allocations 4/4 both; fully fresh coverage 94.98% lines, 89.58% branches. @codex review

Attach each composed circuit to its nearest logging observer and refresh existing listener metadata instead of duplicating detached transition registrations.
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed composed circuit observer scoping in c824fa0. Release build; logging 37/37 both; core 1183; exact fresh coverage 95.01% lines, 89.73% branches. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c824fa0978

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Strategy.cs Outdated
Comment thread src/Kevlar/Strategy.cs Outdated
Apply nearest-listener boundaries consistently during append, composition, logging replacement, and shield renaming.
@thomhurst

Copy link
Copy Markdown
Owner Author

Unified nearest-observer scoping for append, rename, composition, and logging replacement in b501abc. Release build; logging 37/37 both; core 1183. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b501abc6d5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Shield.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs Outdated
Validate compositions before observer publication and conservatively capture handled results unless a severity delegate is proven not to inspect its event.
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed pre-validation observer mutation and result-dependent severity in f39aa54. Release build; logging 39/39 both; core 1183; allocations 4/4 both; exact fresh coverage 94.94% lines, 89.60% branches. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f39aa54cf1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Shield.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/KevlarLogEvent.cs
@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: da5ed5003e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar.Extensions.Logging/LoggingTelemetryListener.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/KevlarLoggingOptions.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1b639ca6e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Strategies/CircuitBreaker/CircuitBreakerCore.cs
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed superseded circuit listener registration in e7a4d55. Release build clean; logging tests 43/43 on net8 and net10. @codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e7a4d55716

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Strategies/CircuitBreaker/CircuitBreakerCore.cs Outdated
Comment thread src/Kevlar.Extensions.Logging/LoggerMessages.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

Addressed derived circuit scope lifetime and structured hedge Delay in 6136f32. Release build clean; logging 44/44 both TFMs; core 1183/1183. @codex review

@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6136f322a5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/ShieldExtensions.cs Outdated
@thomhurst

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b9972be546

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Kevlar/Shield.cs
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.

feat(logging): Kevlar.Extensions.Logging — ILogger integration for every strategy event

1 participant