Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
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

Add cgroup decoder to map cgroup id to cgroup path #70

Merged
merged 1 commit into from Jan 21, 2020
Merged

Conversation

@bobrik
Copy link
Collaborator

bobrik commented Jan 21, 2020

Metrics from the example:

$ curl -s http://localhost:9435/metrics | grep ebpf_exporter_cgroup_open_calls_total
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/init.scope"} 29163
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/conntrack-stats-exporter.service"} 100
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/cron.service"} 20439
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/dbus.service"} 88
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/docker.service"} 51
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/lldpd.service"} 2
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/salt-minion.service"} 67
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/syslog-ng.service"} 42
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-journald.service"} 2547
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-networkd.service"} 20
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-resolved.service"} 5
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4076.slice/session-271566.scope"} 165
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4076.slice/user@4076.service/init.scope"} 523
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4079.slice/user@4079.service/init.scope"} 523
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4406.slice/user@4406.service/init.scope"} 523

This requires Linux 4.18 and newer:

Closes #13

Metrics from the example:

```
$ curl -s http://localhost:9435/metrics | grep ebpf_exporter_cgroup_open_calls_total
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/init.scope"} 29163
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/conntrack-stats-exporter.service"} 100
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/cron.service"} 20439
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/dbus.service"} 88
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/docker.service"} 51
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/lldpd.service"} 2
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/salt-minion.service"} 67
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/syslog-ng.service"} 42
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-journald.service"} 2547
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-networkd.service"} 20
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/system.slice/systemd-resolved.service"} 5
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4076.slice/session-271566.scope"} 165
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4076.slice/user@4076.service/init.scope"} 523
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4079.slice/user@4079.service/init.scope"} 523
ebpf_exporter_cgroup_open_calls_total{cgroup="/sys/fs/cgroup/unified/user.slice/user-4406.slice/user@4406.service/init.scope"} 523
```

This requires Linux 4.18 and newer:

* torvalds/linux@bf6fa2c

Closes #13
@bobrik bobrik force-pushed the ivan/cgroup branch from fd20639 to a691aa9 Jan 21, 2020
@bobrik bobrik merged commit 9780ba5 into master Jan 21, 2020
2 checks passed
2 checks passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.