Browse Source

Merge pull request #2 from aaschmid/master

fix compile error with newer prometheus/client_golang versions
pull/1/head
sberk42 4 years ago
committed by GitHub
parent
commit
ef8acfeac5
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 22
      Dockerfile
  2. 1692
      grafana/Dashboard.json
  3. 6
      grafana/README.md
  4. 3
      main.go

22
Dockerfile

@ -0,0 +1,22 @@
FROM golang:1.14.5 AS build-env
LABEL maintainer="Max Schmitt <max@schmitt.mx>"
LABEL maintainer="Andreas Schmid <service@aaschid.de>"
LABEL description="FRITZ!Box Prometheus exporter"
RUN go get -v github.com/aaschmid/fritzbox_exporter && \
cd /go/src/github.com/aaschmid/fritzbox_exporter && \
CGO_ENABLED=0 go build -v -o /exporter
FROM alpine
RUN apk update && apk add ca-certificates
COPY --from=build-env /go/src/github.com/aaschmid/fritzbox_exporter/metrics.json /metrics.json
COPY --from=build-env /exporter /
EXPOSE 9133
ENTRYPOINT ["/exporter"]
CMD ["-listen-address", ":9133", "-metrics-file", "/metrics.json"]

1692
grafana/Dashboard.json

File diff suppressed because it is too large

6
grafana/README.md

@ -1,8 +1,6 @@
# Grafana dashboard working with this exporter
This dashboard is based on the following dashboard:
https://grafana.com/grafana/dashboards/713
https://grafana.com/grafana/dashboards/12579
Instead of influx it uses prometheus and has been modified and enhanced.
The dashboard is now also published to [Grafana](https://grafana.com/grafana/dashboards/12579)
Adjusted to my personal max down- and upstream and upgraded to the newest grafana version.

3
main.go

@ -28,6 +28,7 @@ import (
"github.com/namsral/flag"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
upnp "github.com/sberk42/fritzbox_exporter/fritzbox_upnp"
)
@ -320,7 +321,7 @@ func main() {
prometheus.MustRegister(collector)
prometheus.MustRegister(collect_errors)
http.Handle("/metrics", prometheus.Handler())
http.Handle("/metrics", promhttp.Handler())
fmt.Printf("metrics available at http://%s/metrics\n", *flag_addr)
log.Fatal(http.ListenAndServe(*flag_addr, nil))
}

Loading…
Cancel
Save