diff --git a/main.go b/main.go index 8e7b00a..ce61b22 100644 --- a/main.go +++ b/main.go @@ -7,6 +7,7 @@ import ( "io/ioutil" "log" "net/http" + "strconv" "github.com/cabify/gotoprom" "github.com/prometheus/client_golang/prometheus" @@ -76,8 +77,8 @@ type OntCovidDataByAge struct { AtLeastOneDoseCumulative json.Number `json:"At least one dose_cumulative"` SecondDoseCumulative json.Number `json:"Second_dose_cumulative"` TotalPopulation json.Number `json:"Total population"` - PercentAtLeastOneDose json.Number `json:"Percent_at_least_one_dose"` - PercentFullyVaccinated json.Number `json:"Percent_fully_vaccinated"` + PercentAtLeastOneDose string `json:"Percent_at_least_one_dose"` + PercentFullyVaccinated string `json:"Percent_fully_vaccinated"` } `json:"records"` Limit int `json:"limit"` Links struct { @@ -199,11 +200,11 @@ func updateMetrics() { if err != nil { log.Println(err) } - percentAtLeastOneDose, err := record.PercentAtLeastOneDose.Float64() + percentAtLeastOneDose, err := strconv.ParseFloat(record.PercentAtLeastOneDose, 64) if err != nil { log.Println(err) } - percentFullyVaccinated, err := record.PercentAtLeastOneDose.Float64() + percentFullyVaccinated, err := strconv.ParseFloat(record.PercentFullyVaccinated, 64) if err != nil { log.Println(err) }