Skip to content

Commit

Permalink
Moving span operation clarification to api
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
toumorokoshi committed May 10, 2020
1 parent bae0b66 commit 4dfa80d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 15 additions & 1 deletion specification/trace/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,21 @@ hypothetical account information:
| `get_account/{accountId}` | Also good (using the "HTTP route") |

The `Span`'s start and end timestamps reflect the elapsed real time of the
operation. A `Span`'s start time SHOULD be set to the current time on [span
operation.

For example, an http server span should start right when the request has begun being handled by the server, and end when the response has been completely sent.
This would include the following, if they are present in that particular
request-response cycle:

- receiving the HTTP request
- parsing of the HTTP request
- parsing of the body of the HTTP request
- any web server middleware that is applied
- business logic
- construction of the HTTP response
- sending of the HTTP response

A `Span`'s start time SHOULD be set to the current time on [span
creation](#span-creation). After the `Span` is created, it SHOULD be possible to
change the its name, set its `Attribute`s, and add `Link`s and `Event`s. These
MUST NOT be changed after the `Span`'s end time has been set.
Expand Down
12 changes: 0 additions & 12 deletions specification/trace/semantic_conventions/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,6 @@ For an HTTP client span, `SpanKind` MUST be `Client`.
If set, `http.url` must be the originally requested URL,
before any HTTP-redirects that may happen when executing the request.

The span start time SHOULD be as close as possible to the time the client began
the request.

The span end time SHOULD be as close as possible to the time the client finished
receiving the response to the request.

One of the following sets of attributes is required (in order of usual preference unless for a particular web client/framework it is known that some other set is preferable for some reason; all strings must be non-empty):

* `http.url`
Expand Down Expand Up @@ -187,12 +181,6 @@ If the route does not include the application root, it SHOULD be prepended to th

If the route cannot be determined, the `name` attribute MUST be set as defined in the general semantic conventions for HTTP.

The span start time SHOULD be as close as possible to the time the server began
handling the request.

The span end time SHOULD be as close as possible to the time the server completed
the response.

| Attribute name | Notes and examples | Required? |
| :------------- | :----------------------------------------------------------- | --------- |
| `http.server_name` | The primary server name of the matched virtual host. This should be obtained via configuration. If no such configuration can be obtained, this attribute MUST NOT be set ( `net.host.name` should be used instead). | [1] |
Expand Down

0 comments on commit 4dfa80d

Please sign in to comment.