Skip to content

Commit

Permalink
Fix up after rebasing on prometheus upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
oblitorum committed Apr 10, 2024
1 parent c9c5d65 commit e1883a1
Show file tree
Hide file tree
Showing 12 changed files with 322 additions and 507 deletions.
16 changes: 16 additions & 0 deletions collector/collector.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,19 @@ func pushMetric(ch chan<- prometheus.Metric, fieldDesc *prometheus.Desc, name st

ch <- prometheus.MustNewConstMetric(fieldDesc, valueType, fVal, labelValues...)
}

// Collectors returns a name list of registered/available collectors
func Collectors() []string {
collectors := make([]string, 0)
for k := range collectorState {
collectors = append(collectors, k)
}
return collectors
}

// SetCollectorState sets state of a registered/available collector
func SetCollectorState(name string, state bool) {
if _, ok := collectorState[name]; ok {
collectorState[name] = &state
}
}
124 changes: 0 additions & 124 deletions collector/gmond.go

This file was deleted.

2 changes: 1 addition & 1 deletion collector/textfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import (
)

var (
textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("").String()
textFileDirectory = kingpin.Flag("collector.textfile.directory", "Directory to read text files with metrics from.").Default("/opt/ss/ssm-client/textfile-collector").String()
mtimeDesc = prometheus.NewDesc(
"node_textfile_mtime_seconds",
"Unixtime mtime of textfiles successfully read.",
Expand Down
43 changes: 30 additions & 13 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,55 @@ require (
github.com/prometheus/common v0.45.0
github.com/prometheus/exporter-toolkit v0.10.0
github.com/prometheus/procfs v0.12.0
github.com/prometheus/promu v0.2.0
github.com/safchain/ethtool v0.3.0
golang.org/x/exp v0.0.0-20230522175609-2e198f4a06a1
golang.org/x/sys v0.13.0
golang.org/x/exp v0.0.0-20230905200255-921286631fa9
golang.org/x/sys v0.15.0
gopkg.in/ini.v1 v1.67.0
gopkg.in/yaml.v2 v2.4.0
howett.net/plist v1.0.0
github.com/prometheus/promu v0.2.0
)

require (
github.com/alecthomas/units v0.0.0-20211218093645-b94a6e3cc137 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/dennwc/ioctl v1.0.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/go-logfmt/logfmt v0.5.1 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/jpillora/backoff v1.0.0 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/matttproud/golang_protobuf_extensions/v2 v2.0.0 // indirect
github.com/mdlayher/genetlink v1.3.2 // indirect
github.com/mdlayher/socket v0.4.1 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f // indirect
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/sagikazarmark/locafero v0.4.0 // indirect
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/siebenmann/go-kstat v0.0.0-20210513183136-173c9b0a9973 // indirect
github.com/sourcegraph/conc v0.3.0 // indirect
github.com/spf13/afero v1.11.0 // indirect
github.com/spf13/cast v1.6.0 // indirect
github.com/spf13/cobra v1.8.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.18.2 // indirect
github.com/subosito/gotenv v1.6.0 // indirect
github.com/xhit/go-str2duration/v2 v2.1.0 // indirect
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/net v0.17.0 // indirect
golang.org/x/oauth2 v0.12.0 // indirect
golang.org/x/sync v0.3.0 // indirect
golang.org/x/text v0.13.0 // indirect
go.uber.org/atomic v1.9.0 // indirect
go.uber.org/multierr v1.9.0 // indirect
golang.org/x/crypto v0.16.0 // indirect
golang.org/x/net v0.19.0 // indirect
golang.org/x/oauth2 v0.15.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading

0 comments on commit e1883a1

Please sign in to comment.