Go to file
Edson Dias e8a593da2d Update helm/fluxcd api version.
Right now, node-interface-metrics-exporter app is
using beta versions of the Fluxcd and Helm APIs,
and for this reason, some warnings are being thrown.

This change aims to update api versions, removing
beta values following this logic:
Fluxcd:
  - source.toolkit.fluxcd.io/v1beta1
  + source.toolkit.fluxcd.io/v1

Helm:
  - helm.toolkit.fluxcd.io/v2beta1
  + helm.toolkit.fluxcd.io/v2

No changes to yaml file structure are required
for this change.

Test Plan:
PASS: Build ISO & Bootstrap AIO-SX
PASS: Upload and apply node-interface-metrics-exporter.
PASS: Confirm that sysinv.log does not have any
      warnings about beta versions related to
      node-interface-metrics-exporter app.

Story: 2011129
Task: 50471

Change-Id: Ic9c138760e7a42a6ab07616833c7e912f0b6fafd
Signed-off-by: Edson Dias <edson.dias@windriver.com>
2024-06-27 11:44:42 -03:00
2023-12-13 14:40:02 -07:00
2023-09-14 12:33:40 +00:00
2023-12-13 14:40:02 -07:00

app-node-interface-metrics-exporter

app-node-interface-metrics-exporter flux cd app

Top Level Directory Structure

├── app-node-interface-metrics-exporter    # Root Folder
│   ├── debian_build_layer.cfg
│   ├── debian_iso_image.inc
│   ├── debian_pkg_dirs
│   ├── metrics-exporter-api              # Go code  for  api server which will expose  Metrics for  NIC .
│   ├── python3-k8sapp-node-interface-metrics-exporter    # lifecycle managemnt code  to support  flux apps
│   ├── README.md
│   ├── requirements.txt
│   ├── stx-node-interface-metrics-exporter      # helm Package manager  for the app
│   ├── test-requirements.txt
│   └── tox.ini

all command related to go code should run from app-node-interface-metrics-exporter/metrics-exporter-api/docker/metrics-exporter-api

About metrics-exporter-api

It is Simple Http Server which reads network interface (PCI devices) and exposes following API's

  1. http://{hostname}:{port}/metrics -- all node metrics in OpenMetrics format
  2. http://{hostname}:{port}/metrics/device/{DeviceName} -- specified interface metrics identified by device name in OpenMetrics format
  3. http://{hostname}:{port}/metrics/pci-addr/{PciAddr} -- specified interface metrics identified by PCI address in OpenMetrics format
  4. http://{hostname}:{port}/json/metrics -- all node metrics in JSON format
  5. http://{hostname}:{port}/json/metrics/device/{DeviceName} -- specified interface metrics identified by device name in JSON format
  6. http://{hostname}:{port}/json/metrics/pci-addr/{PciAddr} -- specified interface metrics identified by PCI address in JSON format

Makefile Support

$ make
help:                Show this help.
install_dep:         install go dependency
run:                 run app on host machine
test:                run go unit test
testcov:             run go coverage test
vet:                 run go vet
lint:                run go lint
build_linux:         Build application
build_image:         Build docker image

$ make run will start go dev http server

Run time Options / params for the metrics-exporter-app usage

Options Help
-log.file Log file name (default "node_metrics_api.log")
-log.level log level. (default "info"). Valid options trace, debug, info, warning, error, fatal and panic
-log.file Log file name (default "node_metrics_api.log")
-web.listen-address Port to listen on for web interface. (default ":9110")
-path.sys mounted path for host /sys inside container (default "/sys")

Local / Devlopment Set UP for metrics-exporter-api

pre requisite go 1.21.0

Container image reference for helm

Dockerfile

Build Reference

References

StarlingX

How to add a FluxCD App to Starlingx

OpenMetrics

Description
StarlingX Node Interface Metrics Exporter App
Readme 20 MiB
Languages
Go 69%
Python 21.8%
Makefile 7.8%
Dockerfile 1.3%