-
Notifications
You must be signed in to change notification settings - Fork 893
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
Resource host.hostname and host.name confusing #787
Comments
Good catch, it looks to me like if these slipped through when resource conventions were consolidated rather than having both separately on purpose. @tigrannajaryan maybe you can shed some light on that? |
@arminru this is coming from OpenCensus conventions: https://github.com/census-instrumentation/opencensus-specs/blob/master/resource/StandardResources.md that were originally written by @bogdandrutu so maybe he can help clarify what the intent was. |
The examples at the linked spec are all the same string. I think the spec should either have a definition (ideally with an example of a typical situation) of how these can be different, or we remove |
Ok o remove the hostname. Will do a PR. |
Fixes open-telemetry#787 Idea from the issue is that we should use `host.name` with either of the proposed values. Signed-off-by: Bogdan Drutu <[email protected]>
While looking at existing usages I came across hostname defined in spans: Is there a reason the semantic conventions need to differ between metrics and traces? |
@jrcamp There should not be any semantic difference between span attributes and metric labels of the same name (see #832 which will explicitly specify this in the spec). Resource attributes, which this PR is about, however, are different. They describe the entity from which the traces and metrics originate. |
#838 removed Should every |
@markdascher thanks for catching.
Yes, I think so.
Yes, that is fine, since it is clearly a bug in the spec, we just forgot to update it. Bug fixes are allowed in stable documents. Would you be able to submit a PR to fix this or file an issue to get this fixed? |
Sure, I filed #3102 with the details. Thanks for confirming! |
I find the fact that
Resource
has two very similar attributes to be confusing, especially in terms of how to actually implement them in instrumentation.https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/resource/semantic_conventions/host.md#host
host.hostname - Hostname of the host. It contains what the hostname command returns on the host machine.
host.name - Name of the host. It may contain what hostname returns on Unix systems, the fully qualified, or a name specified by the user.
First inclination is the
hostname
command seems OS-specific (though I think all even windows do have it in practice) and it's strange to have a whole attribute dedicated to it.I also wonder where other ways of getting hostname, such as polling a cloud service, or runtime hooks like
InetAddress.getLocalHost().getHostName()
fit in.And I've seen this sort of complex logic to get a "good hostname". It seems to work great in practice. If this is a good way of getting hostname, maybe we can document this as the spec of
host.name
and deletehost.hostname
?https://github.com/line/armeria/blob/master/core/src/main/java/com/linecorp/armeria/common/util/SystemInfo.java#L205
The text was updated successfully, but these errors were encountered: