Skip to content

Commit

Permalink
Merge pull request #41 from Chia-Network/0.2.0-fixes
Browse files Browse the repository at this point in the history
0.2.0 fixes
  • Loading branch information
cmmarslender authored Jun 22, 2022
2 parents 1e7a197 + ea7338e commit b238220
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module github.com/chia-network/chia-exporter
go 1.17

require (
github.com/chia-network/go-chia-libs v0.0.7
github.com/chia-network/go-chia-libs v0.0.8
github.com/oschwald/maxminddb-golang v1.8.0
github.com/prometheus/client_golang v1.12.0
github.com/sirupsen/logrus v1.8.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghf
github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE=
github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/chia-network/go-chia-libs v0.0.7 h1:upXSFc7gjUyASY0pjHQgRoBcIdBvGEAin+pXuIixMbU=
github.com/chia-network/go-chia-libs v0.0.7/go.mod h1:h1y8enwmbHVylzRDd5jA9C7RZMXX82pV8/rviB7L4V8=
github.com/chia-network/go-chia-libs v0.0.8 h1:+SFTjw6oxM3KrbJoPd6SiForpaKK8pSjd9N8QmI40MM=
github.com/chia-network/go-chia-libs v0.0.8/go.mod h1:h1y8enwmbHVylzRDd5jA9C7RZMXX82pV8/rviB7L4V8=
github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI=
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI=
github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU=
Expand Down
7 changes: 6 additions & 1 deletion internal/metrics/fullnode.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package metrics

import (
"encoding/json"
"errors"
"fmt"
"os"
"time"
Expand Down Expand Up @@ -330,9 +331,13 @@ func (s *FullNodeServiceMetrics) RefreshFileSizes() {
}

func setGaugeToFilesize(file string, g *wrappedPrometheus.LazyGauge) error {
log.Debugf("Getting filesize of %s\n", file)
log.Debugf("file: chia_full_node Getting filesize of %s\n", file)
fi, err := os.Stat(file)
if err != nil {
if errors.Is(err, os.ErrNotExist) {
log.Debugf("file: chia_full_node file doesn't exist: %s\n", file)
return nil
}
return err
}

Expand Down
7 changes: 5 additions & 2 deletions internal/metrics/harvester.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
log "github.com/sirupsen/logrus"

wrappedPrometheus "github.com/chia-network/chia-exporter/internal/prometheus"
"github.com/chia-network/chia-exporter/internal/utils"
)

// Metrics that are based on Harvester RPC calls are in this file
Expand Down Expand Up @@ -60,7 +59,11 @@ func (s *HarvesterServiceMetrics) httpGetPlots() {
// get_plots seems to sometimes not respond on websockets, so doing http request for this
log.Debug("Calling get_plots with http client")
plots, _, err := s.metrics.httpClient.HarvesterService.GetPlots()
utils.LogErr(plots, nil, err)
if err != nil {
log.Warnf("Could not get plot information from harvester: %s\n", err.Error())
return
}

s.ProcessGetPlots(plots)
}

Expand Down

0 comments on commit b238220

Please sign in to comment.