Skip to content

Request Identification by Header Value #2292

Open
@mpoemsl

Description

@mpoemsl

🚀 The feature

Parse an external request id from a custom header value. This request id is used as a prefix to the TorchServe-internal request id which occurs in logs. The uniqueness of internal ids is still guaranteed, since the suffix is the uuid as generated by the current method.

The feature is optional and backwards compatible in the sense that for requests for which the header is not set, the current request id behavior is retained.

Motivation, pitch

If TorchServe is used as part of a microservice architecture, this feature makes the tracing of individual requests across the whole architecture easier.

Alternatives

No response

Additional context

I implemented this feature as part of my work at @textshuttle in a manner customized to their products' needs. If there is interest in this feature, I could create a more general PR for this feature. Note that users that do not need this feature can choose to simply not set the header value and retain the current behavior.

Metadata

Metadata

Assignees

No one assigned

    Labels

    javaPull requests that update Java code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions