Skip to content

Support X-Trace-Id HTTP header and traceId message in logs #169

@MikeNeilson

Description

@MikeNeilson

As USACE/cwms-data-api#1666
and opendcs/opendcs#1845

Support created at session start or using provided Trace ID UUID value.

This value needs to propagate into any thread used to process the specific request. It should also propagate to external HTTP requests as X-Trace-Id is a defacto standard. This should especially be passed along to any internal systems like CDA.

NOTE: it should not directly propagate to messages, as the purpose of messages is to decouple things.

NOTE: primary need is user requests; however, such a tool is also useful to match general system operations.

Suggested implementation:

  1. If provided, and valid, use it
  2. If provided, and invalid, fail quickly
  3. If not provided generated at session start (excluding login, this let's us trace the whole sequence) and return to user, but keep in session object if any.
  4. On error, return as the "incident identifier" so we can correlate things between logs.

OpenDCS and CDA implementation look in the current request session data and use if already provided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions