metalmatze / transmission-exporter

Prometheus exporter for Transmission metrics, written in Go.
MIT License
99 stars 40 forks source link

Fix LastScrapeTimedOut type #24

Closed LiJinyao closed 4 years ago

LiJinyao commented 4 years ago

I get a warning says

2020/06/27 22:16:12 failed to get torrents: json: cannot unmarshal bool into Go struct field TrackerStat.arguments.torrents.trackerStats.lastScrapeTimedOut of type int

After reading the transmission rpc-spec.txt, I found that the type of LastScrapeTimedOut is boolean. So I changed the type and it works good with no warning on the latest transmission.

vosdev commented 4 years ago

This fixes #26 , would like to see this merged :-)

lededje commented 4 years ago

If you want to use this before it gets merged as I do, I created a Docker file that pulls the changes from @LiJinyao:

FROM golang:1.14

RUN go get github.com/LiJinyao/transmission-exporter

WORKDIR /go/src/github.com/LiJinyao/transmission-exporter

RUN make

RUN make build

FROM alpine:latest

RUN apk add --update ca-certificates

COPY --from=0 /go/src/github.com/LiJinyao/transmission-exporter/transmission-exporter /usr/bin/transmission-exporter

RUN chmod +x /usr/bin/transmission-exporter

EXPOSE 19091

ENTRYPOINT ["/usr/bin/transmission-exporter"]

Please Note This docker file doesn't target a specific hash, but instead the head of this pr branch. If LiJinyao pushes anything else you will build that too. I don't have enough experience with Go to make Go Mods work correctly.

vosdev commented 4 years ago

Awesome! @metalmatze Can we get a new release? :-)