Skip to content

Commit

Permalink
Merge pull request #9 from samcm/feat/eth-modules
Browse files Browse the repository at this point in the history
feat(args): Add execution-modules argument
  • Loading branch information
samcm committed May 16, 2022
2 parents 9554c65 + e49d4f1 commit 790c6d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ var (
executionUrl string
consensusUrl string
monitoredDirectories []string
executionModules []string
)

// Execute adds all child commands to the root command and sets flags appropriately.
Expand All @@ -57,6 +58,7 @@ func init() {
rootCmd.PersistentFlags().StringVarP(&executionUrl, "execution-url", "", "", "(optional) URL to the execution node")
rootCmd.PersistentFlags().StringVarP(&consensusUrl, "consensus-url", "", "", "(optional) URL to the consensus node")
rootCmd.PersistentFlags().StringSliceVarP(&monitoredDirectories, "monitored-directories", "", []string{}, "(optional) directories to monitor for disk usage")
rootCmd.PersistentFlags().StringSliceVarP(&executionModules, "execution-modules", "", []string{}, "(optional) execution modules that are enabled on the node")

// Cobra also supports local flags, which will only run
// when this action is called directly.
Expand Down Expand Up @@ -108,6 +110,10 @@ func initCommon() {
config.DiskUsage.Directories = monitoredDirectories
}

if len(executionModules) > 0 {
config.Execution.Modules = executionModules
}

export = exporter.NewExporter(log, config)
if err := export.Init(ctx); err != nil {
logrus.Fatal(err)
Expand Down
2 changes: 1 addition & 1 deletion pkg/exporter/disk/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func NewMetrics(log logrus.FieldLogger, namespace string) Metrics {
diskUsage: prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Namespace: namespace,
Name: "disk_usage",
Name: "usage_bytes",
Help: "How large the directory is (in bytes).",
ConstLabels: constLabels,
},
Expand Down

0 comments on commit 790c6d7

Please sign in to comment.