Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

Client: Collect metrics from Local FCOS machines #30

Open
15 tasks done
zonggen opened this issue Sep 16, 2019 · 7 comments
Open
15 tasks done

Client: Collect metrics from Local FCOS machines #30

zonggen opened this issue Sep 16, 2019 · 7 comments

Comments

@zonggen
Copy link
Member

zonggen commented Sep 16, 2019

A top level TODO list for future fedora-coreos-pinger work:

Data collection:

minimal (default):

  • Platform (cloud environment or hypervisor)
  • Current OS version
  • Original OS version
  • On cloud systems, the instance type
    • Involves fetching instance type in Afterburn and read the fetched metadata
      • AWS
      • Azure
      • CloudStack
      • DigitalOcean
      • GCP
      • OpenStack
      • Packet

full:

  • On bare-metal systems, a summary of hardware
  • Summary of network configuration
  • Container runtimes in use

Persistent state for timer:

  • Add DynamicUser= and StateDirectory= in service file

Reference:

@zonggen
Copy link
Member Author

zonggen commented Sep 19, 2019

Will be breaking this card into three separate parts:

  • Client data collection
  • Server side data receiving and aggregating
  • Protocol design

@zonggen zonggen changed the title TODO: Collect metrics from FCOS Client: Collect metrics from FCOS Sep 19, 2019
@zonggen zonggen changed the title Client: Collect metrics from FCOS Client: Collect metrics from Local FCOS machines Sep 19, 2019
@zonggen
Copy link
Member Author

zonggen commented Sep 19, 2019

For OS version, it is collected from /etc/os-release.

Collecting original OS version seems like it requires persistent state if we want to send the info about original OS version each time we are sending the data. On the other hand, make an OS version info persistent on disk doesn't sound secure (?), need someone to confirm if I understand this correctly.

@bgilbert
Copy link
Contributor

Collecting original OS version seems like it requires persistent state if we want to send the info about original OS version each time we are sending the data.

The OS should record this somewhere for debugging purposes. Pinger shouldn't itself need to save this info.

@zonggen
Copy link
Member Author

zonggen commented Sep 23, 2019

Yes, if pinger could pick up OS version from /.coreos-aleph-version.json (coreos/coreos-assembler#768) then there's no need for pinger itself to maintain the information.

@zonggen
Copy link
Member Author

zonggen commented Oct 11, 2019

For now hardware information will be collected through:

  • disk_info: lsblk --fs --json
  • cpu_info: lscpu --json
  • mem_info: lsmem --json and lsmem --summary
  • net_info: sudo cat /var/run/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection, which is the keyfile consumed by NetworkManager:
[core@coreos ~]$ sudo journalctl -u NetworkManager
...
Oct 11 15:38:00 coreos NetworkManager[994]: <info>  [1570808280.9858] keyfile: add connection /var/run/NetworkManager/system-connections/Wired connection 1.nmconnection c2954a02-862d-37a7-b238-58276a8a290c,"Wired connection 1")
...

@jlebon
Copy link
Member

jlebon commented Oct 11, 2019

net_info: sudo cat /var/run/NetworkManager/system-connections/Wired\ connection\ 1.nmconnection, which is the keyfile consumed by NetworkManager:

Hmm, this seems brittle. Don't have a better suggestion though. @lucab ?
Ouhh, nmcli device show looks machine-digestible-ish.

@zonggen
Copy link
Member Author

zonggen commented Oct 11, 2019

There's also a Rust crate for NM but it hasn't been updating for a while and cargo fails to pull the dependency from crates.io: (https://crates.io/crates/network-manager).

nmcli device show seems like a better option than cat the keyfile

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants