注意:

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

Difference between revisions of "Funtoo:Telemetry/Activities/Phase3"

From Funtoo
Jump to navigation Jump to search
(adding jira issue)
(Adding note where to find ego profile raw info for the funtoo_profiles_info metric)
 
(5 intermediate revisions by the same user not shown)
Line 2: Line 2:
|summary=Engineer a Prometheus Exporter for Funtoo Linux
|summary=Engineer a Prometheus Exporter for Funtoo Linux
|kind=development
|kind=development
|status=active
|status=ongoing
|project=Funtoo:Telemetry
|project=Funtoo:Telemetry
|start_date=2022-03-15
|start_date=2022-03-15
Line 12: Line 12:
Here are the general objectives of Phase 1 of the [[Funtoo:Telemetry|Telemetry Project]]:
Here are the general objectives of Phase 1 of the [[Funtoo:Telemetry|Telemetry Project]]:


* Engineer a custom Golang 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.
* 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.
* 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.


Line 21: Line 21:
=== External Tools ===
=== External Tools ===


There are various external tools that help solve this problem including pre-existing Prometheus based ones like [https://github.com/prometheus/node_exporter node_exporter]. Node exporter should definitely be referenced for direct Golang implementation inspiration of various metric collection functions.
There are various external tools that help solve this problem including per-existing Prometheus based ones like [https://github.com/prometheus/node_exporter 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:
Some other tools that give different perspective on system information collection that possibly can be reversed engineered into Golang:
Line 29: Line 29:
=== Metrics ===
=== Metrics ===


Here is a working list of possible metrics to expose via the Funtoo Linux Prometheus Exporter, they associated metric type, and metric value:
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_packages_install_count'''
* Metric name: '''funtoo_kits_total'''
** Type: Counter
** Type: Gauge
** Value: Integer
** Value: Integer
** About: The number of CatPkgs installed on a Funtoo Linux system
** About: The total quantity of kits available on a Funtoo Linux system (derived from /var/git/meta-repo/)
* Metric name: '''funtoo_kits_last_sync'''
* Metric name: '''funtoo_kits_package_total'''
** Type: Counter
** 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)
** Value: Unix Epoch Time (seconds)
** About: The last time a ego sync was ran to sync the Funtoo Linux kits
** About: The last time a ego sync was ran to sync the Funtoo Linux kits
* Metric name: '''funtoo_kits_info
* Metric name: '''funtoo_kits_info
** Type: gauge
** Type: Gauge
** Value: 1
** Value: 1.0
** About: Includes various labels that map to kit name and kit version, see output from the ego kit command
** About: Includes labels that map to kit name and kit version, see output from the ego kit command
* Metric name: '''funtoo_profiles_info'''
* Metric name: '''funtoo_profiles_info'''
** Type: gauge
** Type: Gauge
** Value: 1
** Value: 1.0
** About: Includes various labels with metadata specifically about the enable Funtoo Linux profiles, see output from the ego profile
** About: Includes various labels with metadata specifically about the enable Funtoo Linux profiles, see output from the ego profile
* Metric name: '''funtoo_os_info'''
** Funtoo profile information can be derived from '''/etc/portage/make.profile/parent'''
** Type: gauge
* Metric name: '''funtoo_os_info'''
** Value: 1
** 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.
** 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'''
* Metric name: '''funtoo_build_info'''
** Type: gauge
** Type: Gauge
** Value: 1
** 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)
** 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)

Latest revision as of 05:13, October 16, 2022

   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)