File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { traceFn } from './trace';
5
5
import { SpanBuilder } from './builder' ;
6
6
import type {
7
7
Attributes ,
8
+ globalThis ,
8
9
SpanContext ,
9
10
SpanCreationOptions ,
10
11
SpanData ,
@@ -190,8 +191,9 @@ export class Trace extends Span {
190
191
}
191
192
headers . append ( 'content-type' , 'application/json' ) ;
192
193
194
+ // Tests
193
195
// TODO: Properly pass trace context down and update the tests
194
- if ( ! headers . has ( 'x-trace-id' ) ) {
196
+ if ( ( globalThis as globalThis ) . MINIFLARE && ! headers . has ( 'x-trace-id' ) ) {
195
197
headers . append ( 'x-trace-id' , this . getTraceId ( ) ) ;
196
198
}
197
199
Original file line number Diff line number Diff line change @@ -144,3 +144,7 @@ export type CfWithTrace = IncomingRequestCfProperties & {
144
144
}
145
145
146
146
export type TracedFn < T > = ( span : Span ) => T ;
147
+
148
+ export interface globalThis {
149
+ MINIFLARE ?: boolean ;
150
+ }
You can’t perform that action at this time.
0 commit comments