node_exporter
node_exporter copied to clipboard
[Question] Can node_exporter support Android?
I was wondering if node_exporter was able to run on Android, so I've downloaded the latest version (arm64) and tried to run it through termux, it started! However, as soon I asked for the metrics I got a huge exception.
It would be cool if that was possible to run and plug the device metrics into grafana.
I would love to be able to support Android. But I have no idea what that crash it about.
Go has a specific GOOS=android
target, so it may be needed for everything to work.
node_exporter works fine when I start as ROOT, maybe you can try that too.
Has anyone tried to run exporter in termux?
Yeap, @pfk-beta my screenshot is an output from termux!
Didn't read carefully posts... @thiagosanches Did you manage to find problematic metrics which failed node_exporter? I have run following command to enable only wifi, and it works:
./node_exporter --collector.disable-defaults --collector.wifi
--edit--
Following command gives me some metrics. If you have idea how to add more collectors, it would be great (e.g. network, battery)
./node_exporter \
--collector.disable-defaults \
--collector.drm \
--collector.edac \
--collector.lnstat \
--collector.meminfo \
--collector.mountstats \
--collector.perf \
--collector.selinux \
--collector.sysctl \
--collector.thermal_zone \
--collector.time \
--collector.uname \
--collector.filesystem
In /metrics
some of these collectors are marked as successfull, but they didn't produce any output.
More detailed stacktrace in attachment stacktrace.txt
More detailed stacktrace in attachment stacktrace.txt
I'll check on my side and I'll share my findings soon.
Hey @pfk-beta , sorry for my delay.
I ran node_exporter
as you asked me and as soon I look at /metrics
the node_exporter process didn't die!!! Which is good.
I do see some data on /metrics
but I have to take a deep look to see if those values makes sense.
Did you get something similar as I got?
Yeah, I have got many similar items. Few of collectors are marked as working, but they did produce nothing. I need to check exporter with rooted devices (even TV :P)
@pfk-beta right now, I can't root my device, but if you can share with us what you got on a rooted device, so @OfficialBoyfriend was right since the beginning 🤣.
@thiagosanches AndroidTV with root gives me a lot more information :)
That's cool @pfk-beta ! How did you manage to root your TV? That's another topic, but I'm curious about it.
@thiagosanches I'm an employee of TV Manufacturer :P
@pfk-beta Now I'm curious, any plans to use the node-exporter in these TVs in general or are you just playing around with it?
@discordianfish in general I have created platform for benchmark deep learning models on android devices. One part of the system is monitoring devices.
@discordianfish I have created simple collector: https://github.com/pfk-beta/node_exporter/commit/6a160db9f0818ef955d52ff8f889fc38c19423f9 , building node_exporter for android is pretty simple. Sorry for quality of my code, but I have learned to code in Go today :P
@pfk-beta Neat, but, we don't allow use of "os/exec"
in the node_exporter.
@SuperQ I was expecting that. So I didn't create PR, but posted as community commit :) If I would rewrite it to parse system files, it will be more prometheus-friendly?
@pfk-beta I'm not too familiar with android but if these metrics are exposed in /proc, you can add support to https://github.com/prometheus/procfs and then use them here. If this is exposed via other APIs, it might make sense to use a android specific external library to do the heavy lifting and use it here.