docs
docs copied to clipboard
adding scaphandre to softwares exposing prometheus metrics
scaphandre is a monitoring agent dedicated to power consumption metrics
Signed-off-by: Benoit Petit [email protected]
Thanks for this. Can you please add a sample of the exporter output?
Of course, here it is :
[...]
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="RDD Process",pid="198047",cmdline="/usr/lib/firefox/firefox-contentproc-parentBuildID20210927210923-prefsLen6212-prefMapSize258899-appdir/usr/lib/firefox/browser197541truerdd"} 546720
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197912",exe="WebExtensions",cmdline="/usr/lib/firefox/firefox-contentproc-childID10-isForBrowser-prefsLen4994-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab"} 11157
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/firefox/firefox-contentproc-childID9-isForBrowser-prefsLen4994-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",pid="197795",exe="Privileged Cont"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197713",exe="Web Content",cmdline="/usr/lib/firefox/firefox-contentproc-childID8-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/firefox/firefox-contentproc-childID7-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",pid="197702",exe="Web Content"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197690",cmdline="/usr/lib/firefox/firefox-contentproc-childID6-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",exe="Web Content"} 33472
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197675",exe="Web Content",cmdline="/usr/lib/firefox/firefox-contentproc-childID5-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab"} 55787
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/firefox/firefox-contentproc-childID4-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",exe="Web Content",pid="197665"} 33472
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/firefox/firefox-contentproc-childID3-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",pid="197661",exe="Web Content"} 11157
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197657",cmdline="/usr/lib/firefox/firefox-contentproc-childID2-isForBrowser-prefsLen373-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab",exe="Web Content"} 22315
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="197623",exe="Web Content",cmdline="/usr/lib/firefox/firefox-contentproc-childID1-isForBrowser-prefsLen1-prefMapSize258899-jsInit286204-parentBuildID20210927210923-appdir/usr/lib/firefox/browser197541truetab"} 1350064
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="GeckoMain",pid="197541",cmdline="/usr/lib/firefox/firefox"} 1104598
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="195032",cmdline="/usr/bin/ssh-agent-D-a/run/user/1000/keyring/.ssh",exe="ssh-agent"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="165653",exe="evince",cmdline="evince/home/bpetit/Nextcloud/ebooks/sustainable_ICT/David_Ekchajzer _M1_Memoire.pdf"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="evince",pid="165050",cmdline="evince/home/bpetit/Nextcloud/ebooks/sustainable_ICT/apc-estimating-data-centers-carbon-footprint.pdf"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/libreoffice/program/soffice.bin--writerfile:///home/bpetit/Nextcloud/documents/emploi/self/micro-entreprise/Modele-facture-auto-entrepreneur.doc",pid="162442",exe="soffice.bin"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/libreoffice/program/oosplash--writerfile:///home/bpetit/Nextcloud/documents/emploi/self/micro-entreprise/Modele-facture-auto-entrepreneur.doc",pid="162426",exe="oosplash"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="162220",exe="evinced",cmdline="/usr/libexec/evinced"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/libexec/gvfsd-http--spawner:1.3/org/gtk/gvfs/exec_spaw/7",pid="158578",exe="gvfsd-http"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/lib/bluetooth/obexd",pid="146850",exe="obexd"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="",exe="loop23",pid="86252"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="server--sh-n/run/user/1000/.flatpak-helper/pkcs11-flatpak-82354--providerp11-kit-trust.sopkcs11:model=p11-kit-trust?write-protected=yes",pid="82358",exe="p11-kit-server"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="82354",exe="flatpak-session",cmdline="/usr/libexec/flatpak-session-helper"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/lib/systemd/systemd-timesyncd",pid="49837",exe="systemd-timesyn"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="systemd-journal",pid="49748",cmdline="/lib/systemd/systemd-journald"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="49744",exe="systemd-resolve",cmdline="/lib/systemd/systemd-resolved"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="49254",exe="systemd-udevd",cmdline="/lib/systemd/systemd-udevd"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="14853",cmdline="/usr/bin/snapuserd",exe="snap"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="gvfsd-dnssd",cmdline="/usr/libexec/gvfsd-dnssd--spawner:1.3/org/gtk/gvfs/exec_spaw/4",pid="7339"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="7329",exe="gvfsd-smb-brows",cmdline="/usr/libexec/gvfsd-smb-browse--spawner:1.3/org/gtk/gvfs/exec_spaw/3"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="7323",exe="gvfsd-network",cmdline="/usr/libexec/gvfsd-network--spawner:1.3/org/gtk/gvfs/exec_spaw/2"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="6343",exe="keepassx",cmdline="keepassx"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="update-notifier",pid="6124",cmdline="update-notifier"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="seahorse",pid="5322",cmdline="/usr/bin/seahorse--gapplication-service"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/usr/libexec/xdg-desktop-portal-gtk",pid="4389",exe="xdg-desktop-por"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="xdg-desktop-por",cmdline="/usr/libexec/xdg-desktop-portal",pid="4385"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="4125",cmdline="/usr/libexec/xdg-document-portal",exe="xdg-document-po"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/snap/snap-store/547/usr/bin/snap-store--gapplication-service",pid="4081",exe="snap-store"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="gsd-printer",cmdline="/usr/libexec/gsd-printer",pid="4066"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="ibus-engine-sim",cmdline="/usr/libexec/ibus-engine-simple",pid="3999"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="6",cmdline="",exe="kworker/0:0H-events_highpri"} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="4",exe="rcu_par_gp",cmdline=""} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{exe="rcu_gp",pid="3",cmdline=""} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{pid="2",exe="kthreadd",cmdline=""} 0
# HELP scaph_process_power_consumption_microwatts Power consumption due to the process, measured on at the topology level, in microwatts
# TYPE scaph_process_power_consumption_microwatts gauge
scaph_process_power_consumption_microwatts{cmdline="/lib/systemd/systemd--system--deserialize25",pid="1",exe="systemd"} 0
# HELP scaph_context_switches_total Number of context switches since boot.
# TYPE scaph_context_switches_total counter
scaph_context_switches_total 3425286706
# HELP scaph_processes_blocked_current Number of processes currently blocked waiting for I/O.
# TYPE scaph_processes_blocked_current gauge
scaph_processes_blocked_current 4
# HELP scaph_processes_running_current Number of processes currently running.
# TYPE scaph_processes_running_current gauge
scaph_processes_running_current 2
# HELP scaph_forks_since_boot_total Number of forks that have occured since boot (number of processes to have existed so far).
# TYPE scaph_forks_since_boot_total counter
scaph_forks_since_boot_total 244200
# HELP scaph_domain_power_microwatts Power measurement relative to a RAPL Domain, in microwatts
# TYPE scaph_domain_power_microwatts gauge
scaph_domain_power_microwatts{domain_id="1",domain_name="uncore",socket_id="0"} 85579
# HELP scaph_domain_energy_microjoules Domain related energy measurement in microjoules.
# TYPE scaph_domain_energy_microjoules counter
scaph_domain_energy_microjoules{domain_id="1",domain_name="uncore",socket_id="0"} 567109449
# HELP scaph_domain_power_microwatts Power measurement relative to a RAPL Domain, in microwatts
# TYPE scaph_domain_power_microwatts gauge
scaph_domain_power_microwatts{socket_id="0",domain_id="0",domain_name="core"} 2855436
# HELP scaph_domain_energy_microjoules Domain related energy measurement in microjoules.
# TYPE scaph_domain_energy_microjoules counter
scaph_domain_energy_microjoules{socket_id="0",domain_id="0",domain_name="core"} 48767258029
# HELP scaph_domain_power_microwatts Power measurement relative to a RAPL Domain, in microwatts
# TYPE scaph_domain_power_microwatts gauge
scaph_domain_power_microwatts{socket_id="0",domain_name="dram",domain_id="2"} 2441385
# HELP scaph_domain_energy_microjoules Domain related energy measurement in microjoules.
# TYPE scaph_domain_energy_microjoules counter
scaph_domain_energy_microjoules{socket_id="0",domain_name="dram",domain_id="2"} 26255833846
# HELP scaph_socket_power_microwatts Power measurement relative to a CPU socket, in microwatts
# TYPE scaph_socket_power_microwatts gauge
scaph_socket_power_microwatts{socket_id="0"} 5125504
# HELP scaph_socket_energy_microjoules Socket related energy measurement in microjoules.
# TYPE scaph_socket_energy_microjoules counter
scaph_socket_energy_microjoules{socket_id="0"} 68113296393
# HELP scaph_host_power_microwatts Power measurement on the whole host, in microwatts
# TYPE scaph_host_power_microwatts gauge
scaph_host_power_microwatts 5125504
# HELP scaph_host_energy_microjoules Energy measurement for the whole host, as extracted from the sensor, in microjoules.
# TYPE scaph_host_energy_microjoules counter
scaph_host_energy_microjoules 68113296393
# HELP scaph_self_domain_records_nb Number of energy consumption Records stored for a Domain
# TYPE scaph_self_domain_records_nb gauge
scaph_self_domain_records_nb{socket_id="0",rapl_domain_name="uncore"} 3
# HELP scaph_self_domain_records_nb Number of energy consumption Records stored for a Domain
# TYPE scaph_self_domain_records_nb gauge
scaph_self_domain_records_nb{socket_id="0",rapl_domain_name="core"} 3
# HELP scaph_self_domain_records_nb Number of energy consumption Records stored for a Domain
# TYPE scaph_self_domain_records_nb gauge
scaph_self_domain_records_nb{socket_id="0",rapl_domain_name="dram"} 3
# HELP scaph_self_socket_records_nb Number of energy consumption Records stored for each socket
# TYPE scaph_self_socket_records_nb gauge
scaph_self_socket_records_nb{socket_id="0"} 3
# HELP scaph_self_socket_stats_nb Number of CPUStat traces stored for each socket
# TYPE scaph_self_socket_stats_nb gauge
scaph_self_socket_stats_nb{socket_id="0"} 6
# HELP scaph_self_topo_procs_nb Number of processes monitored for the host.
# TYPE scaph_self_topo_procs_nb gauge
scaph_self_topo_procs_nb 312
# HELP scaph_self_topo_records_nb Number of energy consumption Records stored for the host.
# TYPE scaph_self_topo_records_nb gauge
scaph_self_topo_records_nb 6
# HELP scaph_self_topo_stats_nb Number of CPUStat traces stored for the host.
# TYPE scaph_self_topo_stats_nb gauge
scaph_self_topo_stats_nb 6
# HELP scaph_self_mem_shared_resident_size Number of resident shared bytes (i.e., backed by a file).
# TYPE scaph_self_mem_shared_resident_size gauge
scaph_self_mem_shared_resident_size 17653760
# HELP scaph_self_mem_resident_set_size Resident set size, measured in bytes.
# TYPE scaph_self_mem_resident_set_size gauge
scaph_self_mem_resident_set_size 22425600
# HELP scaph_self_mem_total_program_size Total program size, measured in bytes.
# TYPE scaph_self_mem_total_program_size gauge
scaph_self_mem_total_program_size 309882880
# HELP scaph_self_cpu_usage_percent CPU % consumed by scaphandre.
# TYPE scaph_self_cpu_usage_percent gauge
scaph_self_cpu_usage_percent 8.92517006802721
# HELP scaph_self_version Version number of scaphandre represented as a float.
# TYPE scaph_self_version gauge
scaph_self_version 0.41
Thanks; some comments/questions:
- The label cmdline can get into high cardinality. Do you know how many total values a user should normally expect?
- scaph_process_power_consumption_microwatts - is is possible to get counters in Joule?
rate()turns those into Watt automagically. Alternatively, could you change to the base unit of Watt, please? - scaph_processes_blocked_current - the _current seems superfluous
- scaph_socket_energy_microjoules - is it possible to change to Joule?
- scaph_self_domain_records_nb - assuming _nb is number, it seems superfluous
- scaph_self_mem_shared_resident_size - should end in _bytes and memory written out
- scaph_self_mem_shared_resident_size - can you do CPU seconds? That way it can be correlated with node_exporter. In this specific use case it might make sense to retain % (or ratio 0-n) as we can not be certain that node_exporter data exists.
- scaph_self_version - we commonly use _info metrics for this. Information in labels, the metric value is always 1
Thanks; some comments/questions:
* The label cmdline can get into high cardinality. Do you know how many total values a user should normally expect?
This is the length of the command line corresponding to the process as returned by procfs. There is no limit yet but we should add one in a near future.
* scaph_process_power_consumption_microwatts - is is possible to get counters in Joule? `rate()` turns those into Watt automagically. Alternatively, could you change to the base unit of Watt, please?
We use microwatts to manipulate more precise values as some processes may use only a small amount of the power consumed by the whole machine. This seems more practical to use round values than floats with a lot of decimals.
* scaph_processes_blocked_current - the _current seems superfluous
You are right, we could remove that to make the name simpler.
* scaph_socket_energy_microjoules - is it possible to change to Joule?
This is the same idea as before. That being said, this particular metric is redundant with the microwatts one, so one or the other should be removed soon.
* scaph_self_domain_records_nb - assuming _nb is number, it seems superfluous
Agreed, we could remove that suffix to.
* scaph_self_mem_shared_resident_size - should end in _bytes and memory written out
Okay, that makes sense.
* scaph_self_mem_shared_resident_size - can you do CPU seconds? That way it can be correlated with node_exporter. In this specific use case it might make sense to retain % (or ratio 0-n) as we can not be certain that node_exporter data exists.
We do get cpu time consumed by each process, in the process of computing the power consumption due to each process. But we don't expose those cpu time related metrics yet (that was not the purpose of the agent in the first place). Do you mean we should add a CPU usage % metric to the power consumption ones ?
* scaph_self_version - we commonly use _info metrics for this. Information in labels, the metric value is always 1
Okay, I didn't know that, my bad.