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

Otel on Windows nodes - Host field with wrong value #685

Closed
cesarfr1 opened this issue Mar 3, 2023 · 5 comments
Closed

Otel on Windows nodes - Host field with wrong value #685

cesarfr1 opened this issue Mar 3, 2023 · 5 comments
Labels
bug Something isn't working Splunk Platform Issue related to Splunk Platform destination Stale

Comments

@cesarfr1
Copy link

cesarfr1 commented Mar 3, 2023

Otel collecting logs on Windows 2022 nodes.
For the host field, the customer is getting its pod name instead of the actual Windows Hostname.
The same behavior is not observed on Linux-based nodes.

@atoulme atoulme added bug Something isn't working Splunk Platform Issue related to Splunk Platform destination labels Mar 30, 2023
@atoulme
Copy link
Contributor

atoulme commented Mar 30, 2023

Please see https://github.com/open-telemetry/opentelemetry-collector-contrib/tree/main/processor/resourcedetectionprocessor

By default, we use the resourcedetectionprocessor with the system detector to determine the host name.

By default the system detector is set to use thehostname_sources ["dns", "os"] and a note in the documentation recommends for Windows hosts to use the lookup source instead.

To produce a FQDN, Windows hosts might have better results using the "lookup" hostname source, which is mentioned below.

Would you please try to customize the chart and add this additional source?

@omrozowicz-splunk
Copy link
Contributor

So the additional context here was that the Windows Node was actually on VMware, managed by the openshift cluster. No resource detection settings worked for it. The ultimate workaround we used here was to update values.yaml with:

agent:
  extraEnvs:
    - name: OTEL_RESOURCE_ATTRIBUTES
      value: "host.name=$(K8S_NODE_NAME)"
  config:
    processors:
      resourcedetection:
        detectors: ["env"]

And this resulted in populating K8S_NODE_NAME env variable as the host name.

@omrozowicz-splunk
Copy link
Contributor

Additionally, we will work on open-telemetry/opentelemetry-collector-contrib#21482 which will allow to choose what detectors will be used for setting up what attributes. So then we'll be able to use env only for host.name and not to loose other attributes.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 10, 2023

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

@github-actions github-actions bot added the Stale label Oct 10, 2023
@atoulme
Copy link
Contributor

atoulme commented Oct 18, 2023

This issue was fixed by @omrozowicz-splunk upstream. Thanks!

@atoulme atoulme closed this as completed Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Splunk Platform Issue related to Splunk Platform destination Stale
Projects
None yet
Development

No branches or pull requests

3 participants