Skip to content

[WIP] Properly support propagation #13

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
5 changes: 4 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
on: push
on:
push:
branches:
- main

jobs:
test:
Expand Down
6 changes: 5 additions & 1 deletion examples/service-binding/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export default {

const serviceBindingSpan = span.startSpan(SPAN_NAME.SERVICE_FETCH, { attributes: { service: 'basic' } });
const res = await env.SERVICE.fetch('https://service/test', {
headers: { 'x-trace-id': `${serviceBindingSpan.getContext().traceId}:${serviceBindingSpan.getContext().spanId}` },
cf: {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
spanContext: serviceBindingSpan.getContext(),
},
});
serviceBindingSpan.end();

Expand Down
Loading