Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

Change request trace ID format #1591

@natemcmaster

Description

@natemcmaster

Follow up to #1578. In this PR, we Kestrel started generating request IDs instead of letting aspnet/Hosting do this. At the moment, request IDs use the same code to generate connection ID and request ID.

We want to enhance this change further by making the requestID to the following format:

//pseudocode
var count = ++_connection.RequestCount;
HttpContext.TraceIdentifier = $"{_connection.ConnectionId}:{count.ToString("X").PadLeft(5, '0')}";

Result:

Connection 1 Id = 001BCA
  Request 1: Id = 001BCA:00000
  Request 2: Id = 001BCA:00001
...
  Request 11: Id= 001BCA:0000B

Connection 2 Id = 001BCB
  Request 1: Id = 001BCB:00000
  Request 2: Id = 001BCB:00001

In the unlikely event there are more than 0xFFFFF (1,048,575) requests per connection, the counter must not truncate to 5 characters, but use as many characters required to express request count in hex.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions