You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Adds a link from the current span to another span, identified by its `span-context`.
34
-
///
35
-
/// Links can be used to connect spans from different traces or within the same trace. Attributes can be attached to the link to provide additional context or metadata.
/// Override the default `span` status, which is unset.
29
+
set-status:func(status:status);
39
30
40
-
// TODO: Set name, is this possible?
41
-
// update-name: func(name: string)
31
+
/// Updates the `span` name.
32
+
update-name:func(name:string);
42
33
43
34
/// Signals that the operation described by this span has now ended.
44
-
end:func();
35
+
///
36
+
/// If a timestamp is not provided then it is treated equivalent to passing the current time.
37
+
end:func(timestamp:option<datetime>);
38
+
}
39
+
40
+
/// Configuration for starting a `span`.
41
+
recordstart-options {
42
+
/// `span-kind` for the new `span`.
43
+
span-kind:option<span-kind>,
44
+
/// Attributes for the new `span`.
45
+
attributes:option<list<key-value>>,
46
+
/// `link`'s for the new `span`.
47
+
links:option<list<link>>,
48
+
/// When the `span` should begin. If this is not provided it defaults to the current time.
49
+
timestamp:option<datetime>,
50
+
}
45
51
46
-
// TODO: Is this possible?
47
-
// end_with_timestamp
52
+
/// Describes a relationship to another `span`.
53
+
recordlink {
54
+
/// Denotes which `span` to link to.
55
+
span-context:span-context,
56
+
/// Attributes describing the link.
57
+
attributes:list<key-value>,
58
+
}
59
+
60
+
/// Describes the relationship between the Span, its parents, and its children in a trace.
61
+
enumspan-kind {
62
+
/// 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.
63
+
client,
64
+
/// Indicates that the span covers server-side handling of a synchronous RPC or other remote request. This span is often the child of a remote client span that was expected to wait for a response.
65
+
server,
66
+
/// Indicates that the span describes the initiators of an asynchronous request. This parent span will often end before the corresponding child consumer span, possibly even before the child span starts. In messaging scenarios with batching, tracing individual messages requires a new producer span per message to be created.
67
+
producer,
68
+
/// Indicates that the span describes a child of an asynchronous consumer request.
69
+
consumer,
70
+
/// Default value. Indicates that the span represents an internal operation within an application, as opposed to an operations with remote parents or children.
71
+
internal
72
+
}
73
+
74
+
/// The `status` of a `span`.
75
+
variantstatus {
76
+
/// The default status.
77
+
unset,
78
+
/// The operation has been validated by an Application developer or Operator to have completed successfully.
79
+
ok,
80
+
/// The operation contains an error with a description.
81
+
error(string),
82
+
}
83
+
84
+
/// Determines how the parent of a `span` should be set.
85
+
variantspan-parent {
86
+
/// The `span`'s parent is the current active span. The current active span is the most recently created and non-closed span. If no spans have been started in the guest this may be a span in the host.
87
+
implicit,
88
+
/// The `span` is a root span and should have no parent.
89
+
is-root,
90
+
/// The `span`'s parent is identified by the given `span-context`.
91
+
span-context(span-context),
48
92
}
49
93
50
94
/// A key-value pair describing an attribute.
@@ -60,50 +104,50 @@ interface traces {
60
104
61
105
/// The value part of attribute `key-value` pairs.
62
106
variantvalue {
107
+
/// A string value.
63
108
%string(string),
109
+
/// A boolean value.
64
110
%bool(bool),
111
+
/// A double precision floating point value.
65
112
%float64(float64),
113
+
/// A signed 64 bit integer value.
66
114
%s64(s64),
115
+
/// A homogeneous array of string values.
67
116
string-array(list<string>),
117
+
/// A homogeneous array of boolean values.
68
118
bool-array(list<bool>),
119
+
/// A homogeneous array of double precision floating point values.
69
120
float64-array(list<float64>),
121
+
/// A homogeneous array of 64 bit integer values.
70
122
s64-array(list<s64>),
71
123
}
72
124
73
125
/// Identifying trace information about a span that can be serialized and propagated.
74
-
// TODO: Make types for the trace-id's and such?
75
126
recordspan-context {
76
-
/// Hexidecimal representation of the trace id.
77
-
trace-id:string,
78
-
/// Hexidecimal representation of the span id.
79
-
span-id:string,
80
-
/// Hexidecimal representation of the trace flags
81
-
trace-flags:string,
82
-
/// Span remoteness
83
-
is-remote:bool,
84
-
/// Entirety of tracestate
85
-
trace-state:string,
127
+
/// The `trace-id` for this `span-context`.
128
+
trace-id:trace-id,
129
+
/// The `span-id` for this `span-context`.
130
+
span-id:span-id,
131
+
/// The `trace-flags` for this `span-context`.
132
+
trace-flags:trace-flags,
133
+
/// Whether this `span-context` was propagated from a remote parent.
134
+
is-remote:bool,
135
+
/// The `trace-state` for this `span-context`.
136
+
trace-state:string,
86
137
}
87
138
88
-
// ????????????????????
89
-
// // TODO: Document this and children.
90
-
// enum span-kind {
91
-
// client,
92
-
// server,
93
-
// producer,
94
-
// consumer,
95
-
// internal
96
-
// }
97
-
98
-
// ??????????????????????
99
-
// // An immutable representation of the entity producing telemetry as attributes.
100
-
// record otel-resource {
101
-
// // Resource attributes.
102
-
// attrs: list<tuple<string, string>>,
103
-
104
-
// // Resource schema url.
105
-
// schema-url: option<string>,
106
-
// }
107
-
}
139
+
/// The trace that this `span-context` belongs to.
140
+
typetrace-id = tuple<u64, u64>;
141
+
142
+
/// The id of this `span-context`.
143
+
typespan-id = u64;
108
144
109
-
// TODO: Do we want set-attribute in addition to set-attributes? I'm leaning towards no
145
+
/// Flags that can be set on a `span-context`.
146
+
flagstrace-flags {
147
+
/// Whether the `span` should be sampled or not.
148
+
sampled,
149
+
}
150
+
151
+
/// 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.
0 commit comments