stevejgordon / CorrelationId

An ASP.NET Core middleware component which synchronises a correlation ID for cross API request logging.
MIT License
558 stars 106 forks source link

Please support W3C Context as hierarchical correlation id #101

Closed svdHero closed 3 years ago

svdHero commented 3 years ago

It seems as if W3C Context is becoming a standard for correlation ids. Would it be possible to add this to the CorrelationId middleware?

In particular, it would be great to have an easy way to generate a parent-id as specified here: https://www.w3.org/TR/trace-context/#parent-id for outgoing requests to other back-end services or when implementing a process manager that generates commands in a CQRS / DDD setting.

This seems cumbersome to do manually and, besides, I would not know how to generate a unique 8 Byte parent-id value anyway, because .NET only offers a 16 Byte GUID.

I also asked for help in this issue, but was only forwarded to the Activity User Guide which I find way to complex for the purpose of just adding and forwarding a W3C correlation id.

stevejgordon commented 3 years ago

Hi @svdHero - I don't plan to extend this library for W3C tracing at this time. W3C Tracing support is built into .NET Core and better for a feature-complete standards-compliant solution. This Microsoft blog may be easier to follow that the Activity user guide.