StarlingX Node Interface Metrics Exporter App
Go to file
Aman Pandae 9f4bbb93d4 Rest API Doc in StarlingX Api-ref
API Request and Response Information added to the
Code Repository. Modified tox and Zuul to build
the doc html pages.

Added docs for the following APIs:
1. /metrics
2. /metrics/device/{device_name}
3. /metrics/pci-addr/{pci_addr}

Story: 2010918
Task: 50889

Change-Id: I720cbabc37b07314ef9fa74f0d39942373e6aec8
Signed-off-by: Aman Pandae <AmanPandae.Mothukuri@windriver.com>
Signed-off-by: AbhishekJ <abhishek.jaiswal@windriver.com>
2024-08-27 09:26:10 -04:00
api-ref Rest API Doc in StarlingX Api-ref 2024-08-27 09:26:10 -04:00
helm-charts/custom/node-interface-metrics-exporter-helm Helm image Sync with Updated Docker Hub tag 2024-07-13 08:43:47 -04:00
metrics-exporter-api Merge "Update container images, and packages for CVE fix" 2024-07-10 19:54:23 +00:00
python3-k8sapp-node-interface-metrics-exporter Label nodes and update Rbac on helm charts 2024-02-05 10:28:17 +00:00
stx-node-interface-metrics-exporter Helm image Sync with Updated Docker Hub tag 2024-07-13 08:43:47 -04:00
.gitignore Rest API Doc in StarlingX Api-ref 2024-08-27 09:26:10 -04:00
.gitreview Added .gitreview 2023-09-14 12:33:40 +00:00
.zuul.yaml Rest API Doc in StarlingX Api-ref 2024-08-27 09:26:10 -04:00
bindep.txt Add Node Interface metrics exporter app to StarlingX 2023-12-04 15:49:18 +00:00
debian_build_layer.cfg App Node Interface Metrics Exporter:directory structure creation 2023-09-27 07:47:52 -04:00
debian_iso_image.inc Refactor stx-node-metrics-expo**-helm package name 2024-05-10 14:34:47 +00:00
debian_pkg_dirs Refactor stx-node-metrics-expo**-helm package name 2024-05-10 14:34:47 +00:00
debian_stable_docker_images.inc Node interface metrics application server code 2023-11-29 19:10:16 +05:30
README.md Refactor stx-node-metrics-expo**-helm package name 2024-05-10 14:34:47 +00:00
requirements.txt App Node Interface Metrics Exporter:directory structure creation 2023-09-27 07:47:52 -04:00
test-requirements.txt Rest API Doc in StarlingX Api-ref 2024-08-27 09:26:10 -04:00
tox.ini Rest API Doc in StarlingX Api-ref 2024-08-27 09:26:10 -04: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