Note

The Funtoo Linux project has transitioned to "Hobby Mode" and this wiki is now read-only.

Funtoo Telemetry Phase3 Activity

From Funtoo
Jump to navigation Jump to search
   Activity Info
Parent ProjectFuntoo:Telemetry
Start Date15 March 2022
End DateNone
Jira IssueFL-9559
Activity KindDevelopment
StatusOngoing
PreviousPhase1

Overview

Engineer a Prometheus Exporter for Funtoo Linux

Objectives

Here are the general objectives of Phase 1 of the Telemetry Project:

  • Engineer a custom Funtoo Prometheus exporter on [code.funtoo.org code.funtoo.org] that can expose all types of fun and useful Prometheus metrics about a Funtoo Linux system.
  • Create a Funtoo Linux Grafana dashboard template that Funtoo Users in a local Grafana instance to visualize a Funtoo Linux system using time series Prometheus metrics.

Research and Development

To accomplish the first objective this Project, build a Prometheus Exporter for Funtoo Linux, the research below is on how to derive system specific information about Funtoo Linux so that that this information can be quickly transcribed into meaningful Prometheus metrics.

External Tools

There are various external tools that help solve this problem including per-existing Prometheus based ones like node_exporter. Node exporter should definitely be referenced for direct Golang implementation inspiration of various metric collection functions.

Some other tools that give different perspective on system information collection that possibly can be reversed engineered into Golang:

Metrics

Here is a working list of candidates for metrics to expose via the Funtoo Linux Prometheus Exporter, their associated metric type, and metric value, and a description of what they measure:

  • Metric name: funtoo_kits_total
    • Type: Gauge
    • Value: Integer
    • About: The total quantity of kits available on a Funtoo Linux system (derived from /var/git/meta-repo/)
  • Metric name: funtoo_kits_package_total
    • Type: Gauge
    • Value: Integer
    • About: The total quantity of kits available on a Funtoo Linux system (derived from /var/git/meta-repo/)
  • Metric name: funtoo_kits_ebuild_total
    • Type: Gauge
    • Value: Integer
    • About: The total quantity of all available ebuild versions on a Funtoo Linux system (derived from /var/git/meta-repo/kits/
  • Metric name: funtoo_kits_package_installed_total
    • Type: Gauge
    • Value: Integer
    • About: The total quantity of installed packages on a Funtoo Linux system (derived from /var/db/pkg/)
  • Metric name: funtoo_kits_last_sync
    • Type: Gauge
    • Value: Unix Epoch Time (seconds)
    • About: The last time a ego sync was ran to sync the Funtoo Linux kits
  • Metric name: funtoo_kits_info
    • Type: Gauge
    • Value: 1.0
    • About: Includes labels that map to kit name and kit version, see output from the ego kit command
  • Metric name: funtoo_profiles_info
    • Type: Gauge
    • Value: 1.0
    • About: Includes various labels with metadata specifically about the enable Funtoo Linux profiles, see output from the ego profile
    • Funtoo profile information can be derived from /etc/portage/make.profile/parent
  • Metric name: funtoo_os_info
    • Type: Gauge
    • Value: 1.0
    • About: Includes various labels with metadata specifically about the Funtoo Linux OS version, possibly including OS version itself, version of ego installed, etc.
  • Metric name: funtoo_build_info
    • Type: Gauge
    • Value: 1.0
    • About: Includes various labels with metadata specifically about the Funtoo Linux Prometheus Exporter, a perfect example is the prometheus_build_info metric that Prometheus exports about itself, which includes goversion (version of Golang binary is built with), revision (git commit hash version was built off of), and version (semantic release version of the exporter, usually maps to a git tag)