Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

prometheus-node-exporter-lua: make it modular and faster #5128

Merged
merged 11 commits into from
Feb 1, 2018

Conversation

champtar
Copy link
Member

Maintainer: @simonswine
Run tested: ar71xx / bulletM2 / openwrt 17.01.4

Description:
make prometheus-node-exporter-lua faster / modular / configurable

@champtar
Copy link
Member Author

Hi @jschornick, @rbo, @frankiexyz, @simonswine, @imaginator,
You all have a fork of openwrt_exporter, so this PR might interest you (comments welcome)

@champtar
Copy link
Member Author

this is still a WIP, instead of adding router side configuration, I will implement params when I have some time
https://github.com/prometheus/node_exporter#filtering-enabled-collectors

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
also reduce calls to output()

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Testing on a bullet m2, uname collector was taking on average 0.12
it now takes 0.0007

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
On my bullet m2, scrape duration goes from between 0.2 and 0.5 to a stable 0.025
We also don't depend on luci anymore

This remove wifi_network_up metric, but this metric was buggy
wifi_network_up{ifname="wlan0-1",ssid="test1",channel="11",mode="Master",bssid="12:34:56:78:9A:BC",country="FR",frequency="2.462"} 1
wifi_network_up{ifname="radio0.network2",ssid="test1",channel="11",mode="Master",country="US",frequency="2.462"} 0

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
As prometheus-node-exporter-lua is a reimplementation of node_exporter,
I'm using "collector" instead of "scraper" and renaming some collectors

put each collector in a separate file

report collector success/failure and duration per scrape
(follow prometheus/node_exporter#516)

allow to filter collectors using "collect[]" params
(see https://github.com/prometheus/node_exporter#filtering-enabled-collectors)

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
this allow to remove libubus-lua/libiwinfo-lua dependency from main package
this also allow to have different scrape_interval

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>

split stations

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
nat_traffic is too verbose to be really useful by default
netstat is broken by default on OpenWrt/LEDE

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
replace 2 string.match and 1 string.gmatch (space_split)
by 1 string.match

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
@champtar
Copy link
Member Author

champtar commented Dec 9, 2017

Ping @simonswine,
I've now implemented "collect[]" params

@simonswine
Copy link
Contributor

Thanks this all looks really good to me (not written too much lua lately). Sorry for the long time it took to respond.

I like your modularization efforts. I am not too sure I think we should work a separate git repo, which then can be pulled in using a commit into that packages repo. Otherwise we gonna end up having even more forks than we have right now.

Someone invited me to that organization and that would IMHO a good point of contact for all things openwrt_exporter: https://github.com/openwrt-exporter/openwrt_exporter

WDJT @champtar?

@champtar
Copy link
Member Author

Hi @simonswine
I'm not sure we gain anything having an external repo, as this is not going to be used on anything else than OpenWRT, and we need to adapt the Makefile each time we add a new collector anyway (I don't expect to see a lot of changes on already existing collectors)
Regarding the forks just put a note in the README saying that development is now here and you are done ;)

@champtar
Copy link
Member Author

Ping @simonswine It's really simpler to have everything in this repo
Also if you don't mind I would like to take maintainership of this package

@simonswine
Copy link
Contributor

I don't really care, but I can image that if every package handles it like that, there is a lot of noise for the MAINTAINERS of this repo. So do what ever you think is best 🙂

@aparcar
Copy link
Member

aparcar commented Feb 1, 2018

@champtar Anything blocking the merge?

@champtar champtar merged commit 367a1c7 into openwrt:master Feb 1, 2018
@champtar
Copy link
Member Author

champtar commented Feb 1, 2018

Let's give it a try!
I'll try to follow up on https://github.com/openwrt-exporter/openwrt_exporter, see if we can agree on either work here, on move everything there

@champtar champtar deleted the prometheus branch July 25, 2018 21:23
champtar added a commit that referenced this pull request Jul 25, 2018
This was OKed sometimes ago by @simonswine
#5128

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
champtar added a commit that referenced this pull request Jul 25, 2018
This was OKed sometimes ago by @simonswine
#5128

Signed-off-by: Etienne Champetier <champetier.etienne@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants