-
Notifications
You must be signed in to change notification settings - Fork 332
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[nfc] Refactor and add trace span RPC code
This will be used to better export user tracing spans in a follow-up PR.
- Loading branch information
Showing
4 changed files
with
94 additions
and
20 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
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,30 @@ | ||
# Copyright (c) 2017-2022 Cloudflare, Inc. | ||
# Licensed under the Apache 2.0 license found in the LICENSE file or at: | ||
# https://opensource.org/licenses/Apache-2.0 | ||
|
||
@0xc40f73be329a38d9; | ||
|
||
using Cxx = import "/capnp/c++.capnp"; | ||
$Cxx.namespace("workerd::rpc"); | ||
|
||
# This file contains trace helper structures. The Trace struct is deliberately not defined here – | ||
# many files just need to have the span/tag definitions available. Since Trace contains interfaces, | ||
# it also causes a large amount of code to be generated in the .capnp.h file, which affects header | ||
# parsing overhead/compile times for every file that depends on the capnp file defining Trace. | ||
|
||
# The value of a span tag. | ||
struct TagValue { | ||
union { | ||
string @0 :Text; | ||
bool @1 :Bool; | ||
int64 @2 :Int64; | ||
float64 @3 :Float64; | ||
} | ||
} | ||
|
||
# A key/value span tag for tracing. | ||
struct Tag { | ||
key @0 :Text; | ||
value @1 :TagValue; | ||
} | ||
|
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