Skip to content

Commit

Permalink
Please consider some cosmetic changes. (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
KacperPerschke authored Dec 10, 2023
1 parent 90e6a9c commit 94fae3b
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 10 deletions.
1 change: 1 addition & 0 deletions artifactory/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net/http"

"github.com/go-kit/log"

"github.com/peimanja/artifactory_exporter/config"
)

Expand Down
5 changes: 3 additions & 2 deletions artifactory_exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"os"

"github.com/go-kit/log/level"
"github.com/peimanja/artifactory_exporter/collector"
"github.com/peimanja/artifactory_exporter/config"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/prometheus/common/version"

"github.com/peimanja/artifactory_exporter/collector"
"github.com/peimanja/artifactory_exporter/config"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion collector/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@ import (
"sync"

"github.com/go-kit/log"
"github.com/prometheus/client_golang/prometheus"

"github.com/peimanja/artifactory_exporter/artifactory"
"github.com/peimanja/artifactory_exporter/config"
"github.com/prometheus/client_golang/prometheus"
)

// Exporter collects JFrog Artifactory stats from the given URI and
Expand Down
6 changes: 3 additions & 3 deletions collector/openMetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (

"github.com/go-kit/log/level"
"github.com/prometheus/client_golang/prometheus"
io_prometheus_client "github.com/prometheus/client_model/go"
ioPrometheusClient "github.com/prometheus/client_model/go"
"github.com/prometheus/common/expfmt"
)

Expand Down Expand Up @@ -48,9 +48,9 @@ func (e *Exporter) exportOpenMetrics(ch chan<- prometheus.Metric) error {

// create a new metric and collect it
switch family.GetType() {
case io_prometheus_client.MetricType_COUNTER:
case ioPrometheusClient.MetricType_COUNTER:
ch <- prometheus.MustNewConstMetric(desc, prometheus.CounterValue, metric.GetCounter().GetValue())
case io_prometheus_client.MetricType_GAUGE:
case ioPrometheusClient.MetricType_GAUGE:
ch <- prometheus.MustNewConstMetric(desc, prometheus.GaugeValue, metric.GetGauge().GetValue())
}
}
Expand Down
3 changes: 2 additions & 1 deletion collector/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"fmt"

"github.com/go-kit/log/level"
"github.com/peimanja/artifactory_exporter/artifactory"
"github.com/prometheus/client_golang/prometheus"

"github.com/peimanja/artifactory_exporter/artifactory"
)

type user struct {
Expand Down
3 changes: 2 additions & 1 deletion collector/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ import (
"strings"

"github.com/go-kit/log/level"
"github.com/peimanja/artifactory_exporter/artifactory"
"github.com/prometheus/client_golang/prometheus"

"github.com/peimanja/artifactory_exporter/artifactory"
)

const calculateValueError = "There was an issue calculating the value"
Expand Down
3 changes: 2 additions & 1 deletion collector/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import (
"time"

"github.com/go-kit/log/level"
"github.com/peimanja/artifactory_exporter/artifactory"
"github.com/prometheus/client_golang/prometheus"

"github.com/peimanja/artifactory_exporter/artifactory"
)

func (e *Exporter) exportSystem(license artifactory.LicenseInfo, ch chan<- prometheus.Metric) error {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ require (
github.com/go-kit/log v0.1.0
github.com/kelseyhightower/envconfig v1.4.0
github.com/prometheus/client_golang v1.11.1
github.com/prometheus/client_model v0.2.0
github.com/prometheus/common v0.26.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
)
Expand All @@ -20,7 +21,6 @@ require (
github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.1 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/procfs v0.6.0 // indirect
github.com/sirupsen/logrus v1.6.0 // indirect
golang.org/x/sys v0.2.0 // indirect
Expand Down

0 comments on commit 94fae3b

Please sign in to comment.