-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add jaeger bindings to asset-worker (#7761)
- Loading branch information
1 parent
dc2ab35
commit bb85c9a
Showing
6 changed files
with
157 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@cloudflare/workers-shared": minor | ||
--- | ||
|
||
Adds jaeger tracing for asset-worker. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import type { JaegerTracing, Span } from "../../../utils/types"; | ||
|
||
export function mockJaegerBindingSpan(): Span { | ||
return { | ||
addLogs: () => {}, | ||
setTags: () => {}, | ||
end: () => {}, | ||
isRecording: true, | ||
}; | ||
} | ||
|
||
export function mockJaegerBinding(): JaegerTracing { | ||
return { | ||
enterSpan: (_, span, ...args) => { | ||
return span(mockJaegerBindingSpan(), ...args); | ||
}, | ||
getSpanContext: () => ({ | ||
traceId: "test-trace", | ||
spanId: "test-span", | ||
parentSpanId: "test-parent-span", | ||
traceFlags: 0, | ||
}), | ||
runWithSpanContext: (_, callback, ...args) => { | ||
return callback(...args); | ||
}, | ||
|
||
traceId: "test-trace", | ||
spanId: "test-span", | ||
parentSpanId: "test-parent-span", | ||
cfTraceIdHeader: "test-trace:test-span:0", | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters