@@ -200,7 +200,7 @@ sub-operations.
200
200
201
201
` Span ` s encapsulate:
202
202
203
- - The operation name
203
+ - The span name
204
204
- An immutable [ ` SpanContext ` ] ( #spancontext ) that uniquely identifies the
205
205
` Span `
206
206
- A parent span in the form of a [ ` Span ` ] ( #span ) , [ ` SpanContext ` ] ( #spancontext ) ,
@@ -212,6 +212,24 @@ sub-operations.
212
212
- A list of timestamped [ ` Event ` s] ( #add-events )
213
213
- A [ ` Status ` ] ( #set-status ) .
214
214
215
+ The _ span name_ is a human-readable string which concisely identifies the work
216
+ represented by the Span, for example, an RPC method name, a function name,
217
+ or the name of a subtask or stage within a larger computation. The span name
218
+ should be the most general string that identifies a (statistically) interesting
219
+ _ class of Spans_ , rather than individual Span instances. That is, "get_user" is
220
+ a reasonable name, while "get_user/314159", where "314159" is a user ID, is not
221
+ a good name due to its high cardinality.
222
+
223
+ For example, here are potential span names for an endpoint that gets a
224
+ hypothetical account information:
225
+
226
+ | Span Name | Guidance |
227
+ | ----------------- | ------------ |
228
+ | ` get ` | Too general |
229
+ | ` get_account/42 ` | Too specific |
230
+ | ` get_account ` | Good, and account_id=42 would make a nice Span attribute |
231
+ | ` get_account/{accountId} ` | Also good (using the "HTTP route") |
232
+
215
233
The ` Span ` 's start and end timestamps reflect the elapsed real time of the
216
234
operation. A ` Span ` 's start time SHOULD be set to the current time on [ span
217
235
creation] ( #span-creation ) . After the ` Span ` is created, it SHOULD be possible to
@@ -238,7 +256,7 @@ as a separate operation.
238
256
239
257
The API MUST accept the following parameters:
240
258
241
- - The operation name. This is a required parameter.
259
+ - The span name. This is a required parameter.
242
260
- The parent Span or parent Span context, and whether the new ` Span ` should be a
243
261
root ` Span ` . API MAY also have an option for implicit parent context
244
262
extraction from the current context as a default behavior.
@@ -428,7 +446,7 @@ started with the explicit timestamp from the past at the moment where the final
428
446
429
447
Required parameters:
430
448
431
- - The new ** operation name** , which supersedes whatever was passed in when the
449
+ - The new ** span name** , which supersedes whatever was passed in when the
432
450
` Span ` was started
433
451
434
452
#### End
0 commit comments