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

failed to convert cpuinfo model to integer: strconv.ParseInt: parsing \"\": invalid syntax" #27675

Closed
kago-dk opened this issue Oct 15, 2023 · 7 comments
Assignees
Labels
bug Something isn't working processor/resourcedetection Resource detection processor

Comments

@kago-dk
Copy link

kago-dk commented Oct 15, 2023

Component(s)

processor/resourcedetection

What happened?

Description

After the implementation of "[processor/resourcedetection] Add support for host cpuinfo attributes #26533", I am getting this warning on my Windows Servers (2022). I have tried to disable most of the CPU attributes without any success.

Warning log line
2023-10-15T06:20:10.734-0700 warn system/system.go:102 failed to get host cpuinfo {"kind": "processor", "name": "resourcedetection/system", "pipeline": "metrics", "error": "failed to convert cpuinfo model to integer: strconv.ParseInt: parsing "": invalid syntax"}

Steps to Reproduce

Use configuration

Expected Result

No warnings should be shown on the Windows Servers.

Actual Result

Collector version

v0.87.0

Environment information

Environment

Windows 2022 Server

OpenTelemetry Collector configuration

resourcedetection/system:
    detectors: ["system"]
    timeout: 2s
    override: false
    system:
      resource_attributes:
        host.arch:
          enabled: false
        host.cpu.cache.l2.size:
          enabled: false
        host.cpu.family:
          enabled: false
        host.cpu.model.id:
          enabled: false
        host.cpu.model.name:
          enabled: false
        host.cpu.stepping:
          enabled: false
        host.cpu.vendor.id:
          enabled: false
        host.id:
          enabled: true
        host.name:
          enabled: true
        os.description:
          enabled: true
        os.type:
          enabled: true         
      hostname_sources: ["os"]

Log output

No response

Additional context

No response

@kago-dk kago-dk added bug Something isn't working needs triage New item requiring triage labels Oct 15, 2023
@github-actions github-actions bot added the processor/resourcedetection Resource detection processor label Oct 15, 2023
@github-actions
Copy link
Contributor

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

@kago-dk
Copy link
Author

kago-dk commented Oct 15, 2023

Ping @ChrsMark

@VihasMakwana
Copy link
Contributor

@kago-dk Thanks for reporting this!
The system detector extracts all the CPU info from the system even if you disable the attributes and I believe this is where the bug kicks in. Disabling the attributes will only stop it from setting the resource attributes.

The library that we rely on doesn't extract some attributes for Windows OS (in this case, the field cpu.Model) and it leaves this field empty. This results in a bug when we try to parse an empty string.

I've submitted a PR. Let's see what the code owners have to say about it.

@Frapschen Frapschen removed the needs triage New item requiring triage label Oct 16, 2023
mx-psi pushed a commit that referenced this issue Oct 16, 2023
**Description:** 
The `system` detector extracts all the `cpu` info from the system even
if you disable the configs and I believe this is where the bug kicks in.
Disabling the settings will only stop it from setting the resource
attributes.

The
[library](https://github.com/shirou/gopsutil/blob/v3.23.9/cpu/cpu_windows.go#L113)
that we rely on doesn't extract some attributes for Windows OS (in this
case, the field `cpu.Model`) and it leaves this field empty. This
results in a bug when we try to parse an empty string.

The long-term fix will be to extract `cpu.Model` in `gopsutil` upstream
library.

**Link to tracking Issue:**
#27675
@VihasMakwana
Copy link
Contributor

@kago-dk I see that the PR is merged, can you take the latest pull and test it out on your end?

JaredTan95 pushed a commit to openinsight-proj/opentelemetry-collector-contrib that referenced this issue Oct 18, 2023
…emetry#27678)

**Description:** 
The `system` detector extracts all the `cpu` info from the system even
if you disable the configs and I believe this is where the bug kicks in.
Disabling the settings will only stop it from setting the resource
attributes.

The
[library](https://github.com/shirou/gopsutil/blob/v3.23.9/cpu/cpu_windows.go#L113)
that we rely on doesn't extract some attributes for Windows OS (in this
case, the field `cpu.Model`) and it leaves this field empty. This
results in a bug when we try to parse an empty string.

The long-term fix will be to extract `cpu.Model` in `gopsutil` upstream
library.

**Link to tracking Issue:**
open-telemetry#27675
@kago-dk
Copy link
Author

kago-dk commented Oct 24, 2023

Resolved in v0.88.0

@kago-dk kago-dk closed this as completed Oct 24, 2023
jmsnll pushed a commit to jmsnll/opentelemetry-collector-contrib that referenced this issue Nov 12, 2023
…emetry#27678)

**Description:** 
The `system` detector extracts all the `cpu` info from the system even
if you disable the configs and I believe this is where the bug kicks in.
Disabling the settings will only stop it from setting the resource
attributes.

The
[library](https://github.com/shirou/gopsutil/blob/v3.23.9/cpu/cpu_windows.go#L113)
that we rely on doesn't extract some attributes for Windows OS (in this
case, the field `cpu.Model`) and it leaves this field empty. This
results in a bug when we try to parse an empty string.

The long-term fix will be to extract `cpu.Model` in `gopsutil` upstream
library.

**Link to tracking Issue:**
open-telemetry#27675
@cwegener
Copy link
Contributor

The system detector extracts all the CPU info from the system even if you disable the attributes and I believe this is where the bug kicks in

There are more bugs btw. see - #33768

@cwegener
Copy link
Contributor

And one more ... #33771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working processor/resourcedetection Resource detection processor
Projects
None yet
Development

No branches or pull requests

4 participants