Add documentation about invalid SpanContext inputs. (#2803)

Resolves #2751
This commit is contained in:
John Watson 2021-02-11 17:53:38 -08:00 committed by GitHub
parent cacf0f18f4
commit 762aca003b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 0 deletions

View File

@ -36,6 +36,11 @@ public interface SpanContext {
/**
* Creates a new {@code SpanContext} with the given identifiers and options.
*
* <p>If the traceId or the spanId are invalid (ie. do not conform to the requirements for
* hexadecimal ids of the appropriate lengths), both will be replaced with the standard "invalid"
* versions (i.e. all '0's). See {@link SpanId#isValid(CharSequence)} and {@link
* TraceId#isValid(CharSequence)} for details.
*
* @param traceIdHex the trace identifier of the {@code SpanContext}.
* @param spanIdHex the span identifier of the {@code SpanContext}.
* @param traceFlags the trace flags of the {@code SpanContext}.
@ -52,6 +57,11 @@ public interface SpanContext {
* Creates a new {@code SpanContext} that was propagated from a remote parent, with the given
* identifiers and options.
*
* <p>If the traceId or the spanId are invalid (ie. do not conform to the requirements for
* hexadecimal ids of the appropriate lengths), both will be replaced with the standard "invalid"
* versions (i.e. all '0's). See {@link SpanId#isValid(CharSequence)} and {@link
* TraceId#isValid(CharSequence)} for details.
*
* @param traceIdHex the trace identifier of the {@code SpanContext}.
* @param spanIdHex the span identifier of the {@code SpanContext}.
* @param traceFlags the trace flags of the {@code SpanContext}.