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

cgroups should not be checked if substate is exited #33

Open
JensErat opened this issue May 20, 2020 · 1 comment
Open

cgroups should not be checked if substate is exited #33

JensErat opened this issue May 20, 2020 · 1 comment
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@JensErat
Copy link

The Context

As described in #12, substates are often more describing. For example, we're using cloud-init, which has a unit of Type=oneshot. Those run a single time, and afterwards have ActiveState=active but SubState=exited.

Example unit:

$ systemctl status cloud-final
● cloud-final.service - Execute cloud user/final scripts
   Loaded: loaded (/lib/systemd/system/cloud-final.service; enabled; vendor preset: enabled)
   Active: active (exited) since Thu 2020-05-07 07:03:55 UTC; 1 weeks 6 days ago
  Process: 1118 ExecStart=/usr/bin/cloud-init modules --mode=final (code=exited, status=0/SUCCESS)
 Main PID: 1118 (code=exited, status=0/SUCCESS)
    Tasks: 0
   Memory: 544.9M
   CGroup: /system.slice/cloud-final.service

The Issue

systemd_exporter tries to scrape cgroup information for this unit. From reading the code, I see this switch/case statement must be extended to exclude some substates (or probably better: include only really active ones, #12 has a more comprehensive list that can be used to derive): https://github.com/povilasv/systemd_exporter/blob/master/systemd/systemd.go#L578

@povilasv povilasv added bug Something isn't working help wanted Extra attention is needed labels May 20, 2020
@povilasv
Copy link
Contributor

Thanks for reporting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants