Constructor
new TraceID(tsHexopt, numberhexopt)
Constructs a new trace ID using the current time.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tsHex |
string |
<optional> |
time stamp to use for trace ID in hexadecimal format |
numberhex |
string |
<optional> |
string of hexadecimal characters for random portion of Trace ID |
Methods
(static) FromString(rawIDopt)
Constructs a new trace ID from provided string. If no string is provided or the provided string is invalid,
log an error but a new trace ID still returned. This can be used as a trace ID string validator.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
rawID |
string |
<optional> |
string to create a Trace ID object from. |
- Source:
(static) Invalid() → {TraceID}
- Source:
Returns:
- a hardcoded trace ID using zeroed timestamp and random ID
- Type
- TraceID
toString() → {string}
Returns a string representation of the trace ID.
- Source:
Returns:
- stringified trace ID, e.g. 1-57fbe041-2c7ad569f5d6ff149137be86
- Type
- string