Skip to content

Conversation

mo-esmp
Copy link
Member

@mo-esmp mo-esmp commented Aug 23, 2025

  • Updated README.md with instructions for using the GetCorrelationId() extension method.
  • Introduced CorrelationIdValueKey constant in Constants.cs.
  • Enhanced CorrelationIdEnricher to store the correlation ID in the HTTP context.
  • Added GetCorrelationId() extension method in HttpContextExtensions.cs.
  • Expanded tests in CorrelationIdEnricherTests.cs to cover various scenarios for correlation ID retrieval.

- Updated `README.md` with instructions for using the `GetCorrelationId()` extension method.
- Introduced `CorrelationIdValueKey` constant in `Constants.cs`.
- Enhanced `CorrelationIdEnricher` to store the correlation ID in the HTTP context.
- Added `GetCorrelationId()` extension method in `HttpContextExtensions.cs`.
- Expanded tests in `CorrelationIdEnricherTests.cs` to cover various scenarios for correlation ID retrieval.
@Copilot Copilot AI review requested due to automatic review settings August 23, 2025 07:57
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds functionality to retrieve correlation IDs from HTTP context and includes comprehensive test coverage. The main purpose is to provide a clean API for accessing correlation IDs that were previously only available through log enrichment.

  • Introduced a new GetCorrelationId() extension method for HttpContext
  • Enhanced the CorrelationIdEnricher to store correlation ID values in HTTP context items
  • Added extensive test coverage for various correlation ID retrieval scenarios

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/Serilog.Enrichers.ClientInfo/Constants.cs Added constant for correlation ID value storage key
src/Serilog.Enrichers.ClientInfo/Enrichers/CorrelationIdEnricher.cs Enhanced to store correlation ID string values in HTTP context
src/Serilog.Enrichers.ClientInfo/Extensions/HttpContextExtensions.cs New extension method for retrieving correlation IDs
test/Serilog.Enrichers.ClientInfo.Tests/CorrelationIdEnricherTests.cs Comprehensive test coverage for correlation ID retrieval scenarios
README.md Documentation for using the GetCorrelationId() extension method

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@mo-esmp mo-esmp merged commit 4f5d99e into master Aug 23, 2025
1 check passed
@mo-esmp mo-esmp deleted the fix-51-get-correlation-id branch August 23, 2025 08:13
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