mirror: Blazing fast w3c Trace Contexts for any JS runtime
0

Configure Feed

Select the types of activity you want to include in your feed.

docs: correct example code snippets

closes: https://github.com/maraisr/tctx/issues/5

Marais Rossouw (Nov 26, 2024, 12:02 PM +1000) e02cd1ae d9daa88d

+4 -4
+4 -4
readme.md
··· 47 47 import * as traceparent from 'tctx/traceparent'; 48 48 import * as tracestate from 'tctx/tracestate'; 49 49 50 - const parent_key = traceparent.parse(request.headers.traceparent); 51 - const parent_state = tracestate.parse(request.headers.tracestate); 52 - parent_state.set('vendor', 'value'); 50 + const parent = traceparent.parse(request.headers.traceparent); 51 + const state = tracestate.parse(request.headers.tracestate); 52 + state.set('vendor', 'value'); 53 53 54 54 fetch('/downstream', { 55 55 headers: { 56 56 traceparent: parent.child(), 57 - tracestate: parent_state, 57 + tracestate: state, 58 58 }, 59 59 }); 60 60 ```