           (verify-record-span-calls
             [{:trace-id 0 :parent-span-id 1 :span-name "service-a" :span-id 2}
              {:trace-id 0 :parent-span-id nil :span-name "service-b" :span-id 1}]
+            @record-span-args)))))
+  (testing "trace ids in header"
+    (let [record-span-args (atom [])]
+      (with-redefs [cmr.system-trace.core/record-span (create-arg-recorder record-span-args)
+                    t/create-id (id-generator)]
+        (let [header-tracing-id 12
+              header-span-id 35
+              request (mock-http-request {h/TRACE_ID_HEADER (str header-tracing-id)
+                                          h/SPAN_ID_HEADER (str header-span-id)})
+              api-b (h/build-request-context-handler api-call-b system)]
+          (is (= "a" (api-b request)))
+          (verify-record-span-calls
+            [{:trace-id header-tracing-id :parent-span-id 0 :span-name "service-a" :span-id 1}
+             {:trace-id header-tracing-id :parent-span-id header-span-id :span-name "service-b" :span-id 0}]
             @record-span-args))))))
  [expected-traces actual-calls]
  (is (= expected-traces (map #(get (vec %) 1) actual-calls)))

  (is (= [:mock-zipkin] (distinct (map first actual-calls))))
  (doseq [[_ _ start stop] actual-calls]
    (is (< (coerce/to-long start) (coerce/to-long stop)))))


(deftest everything-integrated-test
  (testing "no trace ids in header"
    (let [record-span-args (atom [])]
      (with-redefs [cmr.system-trace.core/record-span (create-arg-recorder record-span-args)

  [request]
  (service-b (:request-context request)))

(def mock-zipkin
  {:enabled? true})

(def system
  {:db :mock-db
   :zipkin mock-zipkin})

(defn mock-http-request
  [headers]
