Skip to content

Commit f53e466

Browse files
committed
fixup: update wit
Signed-off-by: Caleb Schoepp <caleb.schoepp@fermyon.com>
1 parent 9d73e16 commit f53e466

File tree

2 files changed

+60
-62
lines changed

2 files changed

+60
-62
lines changed

tests/test-components/components/wasi-observe-tracing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ crate-type = ["cdylib"]
99
[dependencies]
1010
anyhow = "1"
1111
http = "0.2"
12-
spin-sdk = "2.2.0"
12+
spin-sdk = "3.1.0"
1313
wit-bindgen = "0.30.0"

wit/deps/otel/tracing.wit

Lines changed: 59 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
interface tracing {
22
use wasi:clocks/wall-clock@0.2.0.{datetime};
33

4-
/// TODO
4+
/// Called when a span is started.
55
on-start: func(span: span-data, parent: span-context);
66

7-
/// TODO
7+
/// Called when a span is ended.
88
on-end: func(span: span-data);
99

10-
/// TODO
10+
/// Returns the current span context of the host.
1111
current-span-context: func() -> span-context;
1212

13-
/// TODO
13+
/// The data associated with a span.
1414
record span-data {
1515
/// Span context
1616
span-context: span-context,
@@ -41,24 +41,41 @@ interface tracing {
4141
// - parent span id vs parent span context
4242
}
4343

44-
/// An event describing a specific moment in time on a span and associated attributes.
45-
record event {
46-
/// Event name
47-
name: string,
48-
/// Event time
49-
time: datetime,
50-
/// Event attributes
51-
attributes: list<key-value>,
44+
/// Identifying trace information about a span that can be serialized and propagated.
45+
record span-context {
46+
/// The `trace-id` for this `span-context`.
47+
trace-id: trace-id,
48+
/// The `span-id` for this `span-context`.
49+
span-id: span-id,
50+
/// The `trace-flags` for this `span-context`.
51+
trace-flags: trace-flags,
52+
/// Whether this `span-context` was propagated from a remote parent.
53+
is-remote: bool,
54+
/// The `trace-state` for this `span-context`.
55+
trace-state: trace-state,
5256
}
5357

54-
/// Describes a relationship to another `span`.
55-
record link {
56-
/// Denotes which `span` to link to.
57-
span-context: span-context,
58-
/// Attributes describing the link.
59-
attributes: list<key-value>,
58+
/// The trace that this `span-context` belongs to.
59+
///
60+
/// 16 bytes encoded as a hexadecimal string.
61+
type trace-id = string;
62+
63+
/// The id of this `span-context`.
64+
///
65+
/// 8 bytes encoded as a hexadecimal string.
66+
type span-id = string;
67+
68+
/// Flags that can be set on a `span-context`.
69+
flags trace-flags {
70+
/// Whether the `span` should be sampled or not.
71+
sampled,
6072
}
6173

74+
/// Carries system-specific configuration data, represented as a list of key-value pairs. `trace-state` allows multiple tracing systems to participate in the same trace.
75+
///
76+
/// If any invalid keys or values are provided then the `trace-state` will be treated as an empty list.
77+
type trace-state = list<tuple<string, string>>;
78+
6279
/// Describes the relationship between the Span, its parents, and its children in a trace.
6380
enum span-kind {
6481
/// Indicates that the span describes a request to some remote service. This span is usually the parent of a remote server span and does not end until the response is received.
@@ -73,16 +90,6 @@ interface tracing {
7390
internal
7491
}
7592

76-
/// The `status` of a `span`.
77-
variant status {
78-
/// The default status.
79-
unset,
80-
/// The operation has been validated by an Application developer or Operator to have completed successfully.
81-
ok,
82-
/// The operation contains an error with a description.
83-
error(string),
84-
}
85-
8693
/// A key-value pair describing an attribute.
8794
record key-value {
8895
/// The attribute name.
@@ -114,42 +121,35 @@ interface tracing {
114121
s64-array(list<s64>),
115122
}
116123

117-
/// Identifying trace information about a span that can be serialized and propagated.
118-
record span-context {
119-
/// The `trace-id` for this `span-context`.
120-
trace-id: trace-id,
121-
/// The `span-id` for this `span-context`.
122-
span-id: span-id,
123-
/// The `trace-flags` for this `span-context`.
124-
trace-flags: trace-flags,
125-
/// Whether this `span-context` was propagated from a remote parent.
126-
is-remote: bool,
127-
/// The `trace-state` for this `span-context`.
128-
trace-state: trace-state,
124+
/// An event describing a specific moment in time on a span and associated attributes.
125+
record event {
126+
/// Event name
127+
name: string,
128+
/// Event time
129+
time: datetime,
130+
/// Event attributes
131+
attributes: list<key-value>,
129132
}
130133

131-
/// The trace that this `span-context` belongs to.
132-
///
133-
/// 16 bytes encoded as a hexadecimal string.
134-
type trace-id = string;
135-
136-
/// The id of this `span-context`.
137-
///
138-
/// 8 bytes encoded as a hexadecimal string.
139-
type span-id = string;
140-
141-
/// Flags that can be set on a `span-context`.
142-
flags trace-flags {
143-
/// Whether the `span` should be sampled or not.
144-
sampled,
134+
/// Describes a relationship to another `span`.
135+
record link {
136+
/// Denotes which `span` to link to.
137+
span-context: span-context,
138+
/// Attributes describing the link.
139+
attributes: list<key-value>,
145140
}
146141

147-
/// Carries system-specific configuration data, represented as a list of key-value pairs. `trace-state` allows multiple tracing systems to participate in the same trace.
148-
///
149-
/// If any invalid keys or values are provided then the `trace-state` will be treated as an empty list.
150-
type trace-state = list<tuple<string, string>>;
142+
/// The `status` of a `span`.
143+
variant status {
144+
/// The default status.
145+
unset,
146+
/// The operation has been validated by an Application developer or Operator to have completed successfully.
147+
ok,
148+
/// The operation contains an error with a description.
149+
error(string),
150+
}
151151

152-
/// TODO
152+
/// Describes the instrumentation scope that produced a span.
153153
record instrumentation-scope {
154154
/// Name of the instrumentation scope.
155155
name: string,
@@ -165,5 +165,3 @@ interface tracing {
165165
attributes: list<key-value>,
166166
}
167167
}
168-
169-
// TODO: order things

0 commit comments

Comments
 (0)