-
Notifications
You must be signed in to change notification settings - Fork 899
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
And semantic conventions for Display Hints #730
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ Particular operations may refer to or require some of these attributes. | |
<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` --> | ||
|
||
<!-- toc --> | ||
|
||
- [Display hints for spans](#display-hints) | ||
- [General network connection attributes](#general-network-connection-attributes) | ||
* [`net.transport` attribute](#nettransport-attribute) | ||
* [`net.*.name` attributes](#netname-attributes) | ||
|
@@ -16,6 +16,53 @@ Particular operations may refer to or require some of these attributes. | |
|
||
<!-- tocstop --> | ||
|
||
## Display hints | ||
|
||
UIs are expected to utilize all available semantic conventions when choosing how to | ||
display a span, and to make their own decisions about what information is most important. | ||
However, there are cases when display hints can be helpful, especially when the spans | ||
represent a non-standard operation or have a span name which is useful for grouping but | ||
poor for human readability. | ||
|
||
| Attribute name | Notes and examples | | ||
| :----------------- | :------------------------------------------------------------------ | | ||
|`display.name` | a custom span name to display instead of the span name | | ||
|`display.attribute` | the key to the attribute which should be used as the display name | | ||
|`display.type` | clarifies the type of operation being performed | | ||
|
||
|
||
All display hints are optional. These display hints are not required to be set by | ||
instrumentation, and it is not required that UIs respect their values, even when they | ||
are set. | ||
|
||
The value of `display.attribute` MUST match another attribute key, with the expectation that | ||
the value of that attribute will be used as the span name in the display. If both | ||
`display.name` and `display.attribute` are set, `display.name` should take precedence. If | ||
the value of the attribute `display.attribute` points to is unset or empty, this field | ||
should be ignored. | ||
|
||
The `display.type` field may match an appropriate namespace (db, http, faas, etc) or be | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't see how this is specific to display |
||
completely custom. | ||
|
||
### Example | ||
Imagine instrumenting a simple http client, HipClient, which does not have a concept | ||
of routes or handlers. In this case, the span name would default to a low cardinaility grouping | ||
such as "HTTP {METHOD_NAME}". This may be useful for grouping, but it is not nearly as helpful as | ||
the url, or potentially method name plus the url. It may also be helpful to display to the user | ||
that the type of http request was a HipClient request. | ||
|
||
In this example, the low cardinality span name could be replaced with something more readable: | ||
|
||
* **Span Name**: "HTTP GET" | ||
* **display.name**: "GET /account/123" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a rather contrived example. The backends already know when the span is for HTTP from other semantic attributes, and can easily change the display name to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, in some of these cases it is possible for a backend to construct a better display name, but will backends actually choose to override the span name by default in these cases? Adding a display hint when the span name is already known to be bad for human comprehension would make life easier for everyone trying to consume our data. To give other examples, there are two use cases where a backend cannot derive the appropriate name:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think examples in the specification should showcase real scenarios. An example with HTTP span just doesn't make any sense to me, because the new attributes do not provide anything that's not already available to the backend if the span follows the HTTP semantic conventions. Using it as example in the spec is an example of what not to do, since it just wastes bandwidth. Not to mention that HTTP instrumentation is usually done by reusable middleware, not by the end user code. I am not opposed to the display.name attribute, but let's show an example where this attribute enables something that's difficult or even impossible otherwise. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another aspect to think about is that introducing this semantic convention explicitly encourages a pattern of providing data that is clearly static (esp. if using |
||
* **display.type**: "HipClient" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is a clear example of an "operation being performed". Perhaps some other examples would help? What about a server request, message queue, or internal span? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Happy to add more examples. Is there anything in particular that makes this confusing? |
||
|
||
Alternatively, if the `http.url` attribute has been set on the span, it could be referenced | ||
for the display name: | ||
* **Span Name**: "HTTP GET" | ||
* **display.attribute**: "http.url" | ||
* **display.type**: "HipClient" | ||
|
||
## General network connection attributes | ||
|
||
These attributes may be used for any network related operation. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you specify what kind of UI is meant here? "Tracing backends" or the like would make it more clear.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, will do