-
Notifications
You must be signed in to change notification settings - Fork 3.9k
prometheus-node-exporter-lua: expose node_os_info #29247
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,12 +12,22 @@ local labels = { | |
| target = b.release.target | ||
| } | ||
|
|
||
| local os_info = { | ||
| id = string.lower(b.release.distribution), | ||
| name = b.release.distribution, | ||
| pretty_name = b.release.distribution .. " " .. b.release.version, | ||
| version = b.release.version, | ||
| version_id = b.release.version, | ||
| build_id = b.release.revision, | ||
| } | ||
|
Comment on lines
+15
to
+22
|
||
|
|
||
| local b = nil | ||
| local u = nil | ||
| local ubus = nil | ||
|
|
||
| local function scrape() | ||
| metric("node_openwrt_info", "gauge", labels, 1) | ||
| metric("node_os_info", "gauge", os_info, 1) | ||
|
||
| end | ||
|
|
||
| return { scrape = scrape } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the original node exporter also has the following fields:
id_like,image_id,image_version,variant,variant_idversion_codename, but as they are not part of thesystem boardcall, I skipped them here (onlyid_likeis present in OpenWrts/etc/os-release).the og exporter reports
on my system, while the code here does