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

Add ARM64 & ARM32v7 build support #10

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

transilluminate
Copy link

Tested working on Raspberry Pi 4 (Debian 12.4)
Linux 6.1.0-rpi7-rpi-v8 #1 SMP PREEMPT Debian 1:6.1.63-1+rpt1 (2023-11-24) aarch64 GNU/Linux

$ docker build -t ping-exporter .
$ docker run -d -p 9346:9346 --name=ping-exporter ping-exporter
$ curl http://localhost:9346/ping?target=1.1.1.1

# HELP ping_resolve_time Time it take to resolve domain to an IP address
# TYPE ping_resolve_time gauge
ping_resolve_time{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_packets_total Total number of sent pings
# TYPE ping_packets_total gauge
ping_packets_total{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
# HELP ping_packets_success Total number of success pings
# TYPE ping_packets_success gauge
ping_packets_success{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
# HELP ping_packets_failed Total number of failed pings
# TYPE ping_packets_failed gauge
ping_packets_failed{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_packets_loss A percentage of failed pings from the total pings
# TYPE ping_packets_loss gauge
ping_packets_loss{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_resolve_error Boolean metric if there's an error during the resolve (error message will be in "error" label)
# TYPE ping_resolve_error gauge
ping_resolve_error{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 0
# HELP ping_times A histogram of round-trip times
# TYPE ping_times histogram
ping_times_count{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_bucket{le="11", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 1
ping_times_bucket{le="12", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 3
ping_times_bucket{le="16", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 4
ping_times_bucket{le="17", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_bucket{le="+Inf", count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 5
ping_times_min{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 11
ping_times_max{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 17
ping_times_sum{count="5", ip="1.1.1.1", ping_timeout="1000", protocol="v4", resolve_timeout="1000", target="1.1.1.1"} 65

Nice :)

Add ARM64 & ARM32v7 build support
@maciej-gol
Copy link

Doesn't work for me (RPi 4, Debian 11):

$ docker build --no-cache -t ping-exporter .
Sending build context to Docker daemon  134.1kB
Step 1/27 : FROM --platform=linux/amd64 ekidd/rust-musl-builder:1.36.0 as builder
 ---> 199e6dcf7c1c
Step 2/27 : COPY Cargo.toml Makefile ./
 ---> bd8365f2270a
Step 3/27 : COPY src/ ./src/
 ---> 89d8945bffb2
Step 4/27 : RUN make
 ---> [Warning] The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm/v7) and no specific platform was requested
 ---> Running in 51f706c56215
exec /bin/sh: exec format error
The command '/bin/sh -c make' returned a non-zero code: 1

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.

2 participants