Skip to content

docs(rfc-0002): correct span.kind wire format in code sketches - #4316

Closed
DsThakurRawat wants to merge 1 commit into
jaegertracing:mainfrom
DsThakurRawat:docs/rfc-0002-span-kind-wire-format
Closed

docs(rfc-0002): correct span.kind wire format in code sketches#4316
DsThakurRawat wants to merge 1 commit into
jaegertracing:mainfrom
DsThakurRawat:docs/rfc-0002-span-kind-wire-format

Conversation

@DsThakurRawat

Copy link
Copy Markdown

Which problem is this PR solving?

#4275 added the Field encodings on this route table to RFC 0002 and noted that span.kind
arrives as a JSON number, explicitly flagging that "the sketch's comment above assumed" the
protojson enum name. The table landed, but the two code sketches it refers to were left unchanged.

So the document still says both things. The OtelSpan interface comment and the parseOtlpTrace
sketch under Milestone 3.2 tell the reader that kind arrives as "SPAN_KIND_SERVER" and that the
SPAN_KIND_ prefix should be stripped, while the table fifteen lines below the sketch says it is a
JSON number omitted at zero.

The stale wording is the copy sitting inside the function body someone would start from when
implementing 3.2.

Description of the changes

Update both sketches to match the encoding table, and point the reader at it.

How was this change tested?

Verified against jaegertracing/jaeger:latest (v2.20.0, git-commit d65f9516):

$ curl -s localhost:16686/api/v3/traces/5b11c48d2df7db0cca262d6ac53e3a80
...
      "name": "/",
      "kind": 2,
      "startTimeUnixNano": "1785762657367271942",
...

kind is a bare JSON number, and a span posted over OTLP with kind: 0 comes back with the field
absent. The checked-in fixture packages/jaeger-ui/src/utils/fixtures/otlp2jaeger-in.json also
carries kind as a number.

Documentation only; no code paths affected.

Checklist

The OtelSpan interface comment and the parseOtlpTrace sketch both state
that span.kind arrives as the protojson enum name "SPAN_KIND_SERVER" and
that the parser should strip the prefix.

The "Field encodings on this route" table fifteen lines below the sketch
says the opposite, and the paragraph after it already notes that the
sketch's comment assumed wrongly. Both readings remain in the document,
and the incorrect one sits inside the function body a contributor would
copy when implementing Milestone 3.2.

Verified against jaegertracing/jaeger:latest (v2.20.0, git-commit
d65f9516): GET /api/v3/traces/{trace_id} returns "kind": 2 as a bare
JSON number, and the field is absent when the value is UNSPECIFIED. The
checked-in fixture packages/jaeger-ui/src/utils/fixtures/otlp2jaeger-in.json
also carries kind as a number.

Documentation only; no code paths affected.

Signed-off-by: Divyansh Rawat <divyanshrawatofficial@gmail.com>
@DsThakurRawat
DsThakurRawat requested a review from a team as a code owner August 3, 2026 13:55
@DsThakurRawat

Copy link
Copy Markdown
Author

Closing this RFC-0002's code sketches are the subject matter of the LFX #2029 project itself, and I'd rather not pre-empt that discussion. Happy to revisit once the project starts

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant