5.7Setting Trace Identifier
Updated on Aug 20, 2026~2 min read
Assigns a unique identifier to a request to facilitate tracking and debugging. This identifier is set in the X-Trace-ID request header.
HTTP declarative requests set the trace identifier through the TraceIdentifierAttribute attribute. The corresponding HTTP declarative extractor is implemented as the TraceIdentifierDeclarativeExtractor type, which is responsible for parsing the TraceIdentifierAttribute attribute and building the trace identifier configuration required for the HttpRequestBuilder instance.
// Applied on the interface definition, affecting all methods[TraceIdentifier("your-id")]public interface IHttpService : IHttpDeclarative{ [Get("https://furion.net/")] Task<string> GetStringAsync(); // Applied on the method [TraceIdentifier("your-method-id")] [Get("https://furion.net/")] Task<string> GetStringAsync();}TraceIdentifierAttribute includes the following constructors and properties:
-
Constructors:
new(traceIdentifier): Applies to a method or interface, setting the trace identifier.
-
Properties:
Identifier: The trace identifier (stringtype).