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

feat: Add support for CONFIG_CPU_FREQ_STAT #627

Merged
merged 1 commit into from May 13, 2024
Merged

Conversation

rexagod
Copy link
Contributor

@rexagod rexagod commented Apr 1, 2024

Extracts data from the following files:

  • total_trans
  • trans_table
  • time_in_state

Refer: https://www.kernel.org/doc/html/latest/cpu-freq/cpufreq-stats.html#configuring-cpufreq-stats.

Fixes: #428

Extracts data from the following files:
* `total_trans`
* `trans_table`
* `time_in_state`

Refer: https://www.kernel.org/doc/html/latest/cpu-freq/cpufreq-stats.html#configuring-cpufreq-stats.

Fixes: prometheus#428

Signed-off-by: Pranshu Srivastava <rexagod@gmail.com>
if err != nil {
if !(os.IsNotExist(err) || os.IsPermission(err)) {
return &SystemCPUCpufreqStats{}, err
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you not returning the error here but continue silently?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

procfs/sysfs/system_cpu.go

Lines 273 to 275 in 9eed744

if os.IsNotExist(err) || os.IsPermission(err) {
continue
}

For these cases I saw that we were skipping over silently in other parts of the codebase, and kept the norm here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, makes sense

Copy link
Member

@discordianfish discordianfish left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@SuperQ SuperQ merged commit 51f7d13 into prometheus:master May 13, 2024
8 checks passed
SuperQ added a commit that referenced this pull request May 13, 2024
Remove unnecessary nil assignment in `sysfs/system_cpu.go` to fix linter
errors.

Followup to #627

Signed-off-by: SuperQ <superq@gmail.com>
SuperQ added a commit that referenced this pull request May 14, 2024
Remove unnecessary nil assignment in `sysfs/system_cpu.go` to fix linter
errors.

Followup to #627

Signed-off-by: SuperQ <superq@gmail.com>
codeboten pushed a commit to open-telemetry/opentelemetry-collector-contrib that referenced this pull request May 14, 2024
)

[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [github.com/prometheus/procfs](https://togithub.com/prometheus/procfs)
| `v0.14.0` -> `v0.15.0` |
[![age](https://developer.mend.io/api/mc/badges/age/go/github.com%2fprometheus%2fprocfs/v0.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/go/github.com%2fprometheus%2fprocfs/v0.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/go/github.com%2fprometheus%2fprocfs/v0.14.0/v0.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/go/github.com%2fprometheus%2fprocfs/v0.14.0/v0.15.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>prometheus/procfs (github.com/prometheus/procfs)</summary>

###
[`v0.15.0`](https://togithub.com/prometheus/procfs/releases/tag/v0.15.0):
/ 2024-05-14

[Compare
Source](https://togithub.com/prometheus/procfs/compare/v0.14.0...v0.15.0)

#### What's Changed

- Synchronize common files from prometheus/prometheus by
[@&#8203;prombot](https://togithub.com/prombot) in
[prometheus/procfs#635
- enhancement: Use pointer fields for `FibreChannel*` by
[@&#8203;rexagod](https://togithub.com/rexagod) in
[prometheus/procfs#623
- bugfix: Allow multiple `xprt` fields for NFS stats by
[@&#8203;rexagod](https://togithub.com/rexagod) in
[prometheus/procfs#619
- bugfix: `s/TrimRight/TrimSuffix` for certain cases by
[@&#8203;rexagod](https://togithub.com/rexagod) in
[prometheus/procfs#618
- Parse recovery line to be synced blocks by
[@&#8203;SuperQ](https://togithub.com/SuperQ) in
[prometheus/procfs#637
- feat: Add support for `CONFIG_CPU_FREQ_STAT` by
[@&#8203;rexagod](https://togithub.com/rexagod) in
[prometheus/procfs#627
- Fixup sysfs/system_cpu.go lint errors by
[@&#8203;SuperQ](https://togithub.com/SuperQ) in
[prometheus/procfs#638
- Update class_thermal.go to ignore only invalid thermal zones which
raise fs.PathError by
[@&#8203;miliacristian](https://togithub.com/miliacristian) in
[prometheus/procfs#634
- Bump golang.org/x/sys from 0.19.0 to 0.20.0 by
[@&#8203;dependabot](https://togithub.com/dependabot) in
[prometheus/procfs#639

#### New Contributors

- [@&#8203;miliacristian](https://togithub.com/miliacristian) made their
first contribution in
[prometheus/procfs#634

**Full Changelog**:
prometheus/procfs@v0.14.0...v0.15.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "on tuesday" (UTC), Automerge - At any
time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/open-telemetry/opentelemetry-collector-contrib).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zNTEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjM1MS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJyZW5vdmF0ZWJvdCJdfQ==-->

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: opentelemetrybot <107717825+opentelemetrybot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Instantaneous vs. cummulative cpufreq stats
3 participants