-
Notifications
You must be signed in to change notification settings - Fork 897
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
Clarify usage of "component" attribute in semantic conventions #336
Comments
Related: #245 |
At some point the back end at least will often want to decide whether this Span is a DB or a HTTP span (e.g. to display an icon). So the question is: Should the back end decide this (e.g. using heuristics like HTTP + DB => DB), or should the instrumentation decide this? If the latter, the component attribute is helpful. One could also make the point that in practice most likely, the Postresql integration would create a Span with DB attributes and the HTTP integration would create a child span with HTTP attributes instead of the attributes being mixed in a single span. I wonder if we can find an example where we really would have mixed span types. |
My understanding had been that |
The semantic convention requires hard-coded values for "component" field based on the type of the emitter, e.g. "http", so I think it does not align with your understanding (not saying your understanding is wrong - I am not sure what is right here - to me the whole "component" attribute is superfluous). |
@tedsuo What do you think? |
I think we can resolve this by switching to a structured data format. In this case, the "component" tag becomes the key to a dictionary containing semantically defined keys and values. The named tracer which is reporting the spans can also be represented as span attributes. For clarity, let's call that dictionary key "reporter" rather than "component." For example, a python client speaking to mongodb over HTTP might generate a span with the following attributes: {
"reporter": {
"name": "pymongo-opentelemetry",
"version": "1.2.3"
},
"span":{
"kind": "client",
},
"http_client": {
"method": "GET",
"url": "https://example.com:779/path/12314/?q=ddds#123",
"status_code": "200"
},
"db": {
"type": "mongodb",
"statement": "db.getCollection('foo').find()",
"instance": "customers",
},
"tcp": {
"ipv4": "127.0.0.1",
"port": "80"
}
} In this world, as long as there is no collision between key names, there shouldn't be an issue with a span representing multiple types. @Oberon00 I understand the issue you bring up: Should instrumentation define a span "type" to make some UI decisions clearer, such as what icon to show? I lean towards no: it would be better for instrumentation to focus on providing unambiguous, objective data. Subjective decisions, such as wether the icon should be "http" or "client" or "db" might be difficult. Which icon would you pick for an HTTP |
@tedsuo the
I tend to agree. I think backends should make these decisions and to make such decisions they don't need That said I disagree with this part:
I think the structured vs unstructured format is orthogonal to the issue I raised. We can encode {
"reporter.name": "pymongo-opentelemetry",
"reporter.version": "1.2.3"
} |
@tigrannajaryan I see no value in having a hard-coded list of I would propose that we specify a conventional name for the name of of the named |
@jmacd sounds good. I sense that we are all mostly on the same page, so just to summarize what I believe we are suggesting:
(BTW, I'm not necessarily arguing we should staple the |
"component" attribute has been removed from semantic conventions via #447 |
Span Semantic conventions currently define an attribute "component". It is unclear what exactly this attribute is intended to reflect.
Semantic conventions define different values of "component" attribute in each of the sections of the document, as if the sections are exclusive of one another, which seems to be an incorrect assumption. A counter-example to that assumption would be a Database system which is accessible via HTTP transport (e.g. https://wiki.postgresql.org/wiki/HTTP_API). In this counter-example it is unclear whether the "component" should be set to "http" or to "postgresql".
Unless there is a clear intent on the meaning of "component" attribute and what value should be populated when the emitting component logically belongs to different kinds of emitters defined in this document I suggest that we remove the attribute altogether. Consumers of attributes which are interested in learning the type of the component that emitted the span can do so by examining the presence or absence of "Required" attribute of appropriate attribute group. For example the presence of "http.method" attribute would mean that the emitter is an "http" component (perhaps in addition to being something else at the same time).
The text was updated successfully, but these errors were encountered: