openzipkin / zipkin-js

Zipkin instrumentation for Node.js and browsers
Apache License 2.0
564 stars 171 forks source link

Validate traceID and spanID #229

Open jcchavezs opened 6 years ago

jcchavezs commented 6 years ago

ATM we are not validating the traceID neither the spanID making it possible to receive a or abc. I believe it is worth to validate it like in other zipkin implementations.

We have two options:

  1. Validate them in the traceId creation.
  2. Validate only traceId and spanId when they come from upstream.

Ping @eirslett @adriancole

codefromthecrypt commented 6 years ago

usually we do tolerant read and restart if incompatible.

Ex. 'a' is OK, but 'g' is not. We are tolerant reading mixed lengths ex 1, 17 or 31 hex trace ID is fine, but 33 length trace ID or 17 length span Id is invalid, so restart trace and ignore other headers when malformed.