Skip to content
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

Collector fails to start when system detector cannot obtain FQDN of the host #3092

Closed
dmitryax opened this issue Apr 13, 2021 · 2 comments · Fixed by #3099
Closed

Collector fails to start when system detector cannot obtain FQDN of the host #3092

dmitryax opened this issue Apr 13, 2021 · 2 comments · Fixed by #3099
Labels
bug Something isn't working

Comments

@dmitryax
Copy link
Member

dmitryax commented Apr 13, 2021

Problem description
If we have OTel Collector with system detector enabled (resource detection processor), running on a VM that cannot provide fully qualified domain name for a reason, the collector is failing to start. The detector tries to set FQDN to host.name resource attribute, but OTel conventions don't specify that it has to be FQDN. So I don't see a reason why it should be failing.

Suggested solutions
I see two options to solve the problem:

  1. If FQDN cannot be provided by the system, fall back to os.Hostname()
  2. Introduce another resource attribute, e.g. host.fqdm which (if present) will always contain fully qualified domain name of the host.

@jrcamp @mx-psi @tigrannajaryan thoughts?

@dmitryax dmitryax added the bug Something isn't working label Apr 13, 2021
@dmitryax dmitryax changed the title Collector fails to start system fails if fully qualified hostname cannot be obtained Collector fails to start when system detector cannot obtain FQDN of the host Apr 13, 2021
@tigrannajaryan
Copy link
Member

If FQDN cannot be provided by the system, fall back to os.Hostname()

This sounds right to me given that Otel conventions say:

host.name - Name of the host. On Unix systems, it may contain what the hostname command returns, or the fully qualified hostname, or another name specified by the user.

Regarding your second point:

Introduce another resource attribute, e.g. host.fqdm which (if present) will always contain fully qualified domain name of the host.

Yes, we can do it in the future if necessary. For now I would suggest to go with option 1.

@mx-psi
Copy link
Member

mx-psi commented Apr 14, 2021

I opened #3099 to fix this using option 1, PTAL

tigrannajaryan pushed a commit that referenced this issue Apr 14, 2021
#3099)

- Fall back to `os.Hostname` when FQDN is not available.

**Link to tracking Issue:** Fixes #3092
pmatyjasek-sumo pushed a commit to pmatyjasek-sumo/opentelemetry-collector-contrib that referenced this issue Apr 28, 2021
open-telemetry#3099)

- Fall back to `os.Hostname` when FQDN is not available.

**Link to tracking Issue:** Fixes open-telemetry#3092
alexperez52 referenced this issue in open-o11y/opentelemetry-collector-contrib Aug 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants