Skip to content

Commit 4daee3a

Browse files
toumorokoshiarminruOberon00
authored
Clarify semantic conventions around span start and end time (open-telemetry#592)
* Adding http semantic conventions for span start and end times. * Corrected send to end, further clarified timings. * Moving span operation clarification to api Feedback states that the clarification around the meaning of the span start and end times could be more generic. Starting a proposal around by adding an example to the API. * Addressing feedback Rewording recommendation to use a more generic RPC Adding a small blurb clarifying sub operations can be instrumented. * Apply suggestions from code review Co-authored-by: Armin Ruech <[email protected]> Co-authored-by: Christian Neumüller <[email protected]> * Expanding on child spans Co-authored-by: Armin Ruech <[email protected]> Co-authored-by: Christian Neumüller <[email protected]>
1 parent 1d9006d commit 4daee3a

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

specification/trace/api.md

+20-1
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,26 @@ hypothetical account information:
224224
| `get_account/{accountId}` | Also good (using the "HTTP route") |
225225

226226
The `Span`'s start and end timestamps reflect the elapsed real time of the
227-
operation. A `Span`'s start time SHOULD be set to the current time on [span
227+
operation.
228+
229+
For example, if a span represents a request-response cycle (e.g. HTTP or an RPC),
230+
the span should have a start time that corresponds to the start time of the
231+
first sub-operation, and an end time of when the final sub-operation is complete.
232+
This includes:
233+
234+
- receiving the data from the request
235+
- parsing of the data (e.g. from a binary or json format)
236+
- any middleware or additional processing logic
237+
- business logic
238+
- construction of the response
239+
- sending of the response
240+
241+
Child spans (or in some cases events) may be created to represent
242+
sub-operations which require more detailed observability. Child spans should
243+
measure the timing of the respective sub-operation, and may add additional
244+
attributes.
245+
246+
A `Span`'s start time SHOULD be set to the current time on [span
228247
creation](#span-creation). After the `Span` is created, it SHOULD be possible to
229248
change the its name, set its `Attribute`s, and add `Link`s and `Event`s. These
230249
MUST NOT be changed after the `Span`'s end time has been set.

0 commit comments

Comments
 (0)