Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/greenpau/ovs_exporter
Prometheus Exporter for Open Virtual Switch (OVS)
https://github.com/greenpau/ovs_exporter
openvswitch ovs ovsdb prometheus-client prometheus-client-library prometheus-exporter
Last synced: about 2 months ago
JSON representation
Prometheus Exporter for Open Virtual Switch (OVS)
- Host: GitHub
- URL: https://github.com/greenpau/ovs_exporter
- Owner: greenpau
- License: apache-2.0
- Created: 2018-10-29T22:35:10.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-22T17:08:10.000Z (11 months ago)
- Last Synced: 2024-05-23T01:32:12.750Z (7 months ago)
- Topics: openvswitch, ovs, ovsdb, prometheus-client, prometheus-client-library, prometheus-exporter
- Language: Go
- Size: 78.1 KB
- Stars: 23
- Watchers: 5
- Forks: 17
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Open Virtual Switch (OVS) Exporter
Export Open Virtual Switch (OVS) data to Prometheus.
## Introduction
This exporter exports metrics from the following OVS components:
* OVS `vswitchd` service
* `Open_vSwitch` database
* OVN `ovn-controller` service## Getting Started
Run the following commands to install it:
```bash
wget https://github.com/greenpau/ovs_exporter/releases/download/v1.0.4/ovs-exporter-1.0.4.linux-amd64.tar.gz
tar xvzf ovs-exporter-1.0.4.linux-amd64.tar.gz
cd ovs-exporter*
./install.sh
cd ..
rm -rf ovs-exporter-1.0.4.linux-amd64*
systemctl status ovs-exporter -l
curl -s localhost:9475/metrics | grep server_id
```Run the following commands to build and test it:
```bash
cd $GOPATH/src
mkdir -p github.com/greenpau
cd github.com/greenpau
git clone https://github.com/greenpau/ovs_exporter.git
cd ovs_exporter
make
make qtest
```## Exported Metrics
| Metric | Meaning | Labels |
| ------ | ------- | ------ |
| `ovs_up` | Is OVS stack up (1) or is it down (0). | `system_id` |For example:
```bash
$ curl localhost:9475/metrics | grep ovn
# HELP ovs_up Is OVS stack up (1) or is it down (0).
# TYPE ovs_up gauge
ovs_up 1
```## Flags
```bash
./bin/ovs-exporter --help
```## Development Notes
Run the following command to build `arm64`:
```bash
make BUILD_OS="linux" BUILD_ARCH="arm64"
```Next, package the binary:
```bash
make BUILD_OS="linux" BUILD_ARCH="arm64" dist
```After a successful release, upload packages to Github:
```bash
owner=$(cat .git/config | egrep "^\s+url" | cut -d":" -f2 | cut -d"/" -f1)
repo=$(cat .git/config | egrep "^\s+url" | cut -d":" -f2 | cut -d"/" -f2 | sed 's/.git$//')
tag="v$(< VERSION)"
github_api_token="PASTE_TOKEN_HERE"
filename="./dist/${repo}-$(< VERSION).linux-amd64.tar.gz"
upload-github-release-asset.sh github_api_token=${github_api_token} owner=${owner} repo=${repo} tag=${tag} filename=dist/ovs-exporter-$(< VERSION).linux-amd64.tar.gz
upload-github-release-asset.sh github_api_token=${github_api_token} owner=${owner} repo=${repo} tag=${tag} filename=dist/ovs-exporter-$(< VERSION).linux-arm64.tar.gz
```