Skip to content

Commit

Permalink
Merge pull request #65 from Comcast/fix_type_error
Browse files Browse the repository at this point in the history
Fix type error
  • Loading branch information
ibrahimkk-moideen authored Apr 23, 2024
2 parents 435776d + 2ca09a5 commit 4a8a7d2
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 9 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ Flags:
alternative method for logging in addition to stdout
--log.file-path="/var/log/fishymetrics"
directory path where log files are written if log-method is file
--log.file-max-size=256 max file size in megabytes if log-method is file
--log.file-max-backups=1 max file backups before they are rotated if log-method is file
--log.file-max-age=1 max file age in days before they are rotated if log-method is file
--log.file-max-size="256" max file size in megabytes if log-method is file
--log.file-max-backups="1" max file backups before they are rotated if log-method is file
--log.file-max-age="1" max file age in days before they are rotated if log-method is file
--vector.endpoint="http://0.0.0.0:4444"
vector endpoint to send structured json logs to
--port="9533" exporter port
--vault.addr="https://vault.com"
Vault instance address to get chassis credentials from
--vault.role-id="" Vault Role ID for AppRole
--vault.secret-id="" Vault Secret ID for AppRole
--collector.drives.module-exclude=""
--collector.drives.modules-exclude=""
regex of drive module(s) to exclude from the scrape
--credentials.profiles=CREDENTIALS.PROFILES
profile(s) with all necessary parameters to obtain BMC credential from secrets backend, i.e.
Expand Down Expand Up @@ -82,7 +82,7 @@ Since some hosts can contain many dozens of drives, this can cause a scrape to t
Example:
```bash
--collector.drives.module-exclude="(?i)(FlexUtil|(SBMezz|IOEMezz)[0-9]+)"
--collector.drives.modules-exclude="(?i)(FlexUtil|(SBMezz|IOEMezz)[0-9]+)"
```
| Collector | Scope | Include Flag | Exclude Flag |
Expand Down
24 changes: 20 additions & 4 deletions cmd/fishymetrics/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (
"os"
"os/signal"
"regexp"
"strconv"
"strings"
"sync"
"syscall"
Expand Down Expand Up @@ -195,7 +196,7 @@ func main() {

_, err = a.Parse(os.Args[1:])
if err != nil {
panic(fmt.Errorf("Error parsing argument flags - %s", err.Error()))
panic(fmt.Errorf("error parsing argument flags - %s", err.Error()))
}

// populate excludes map
Expand All @@ -215,15 +216,30 @@ func main() {
}
}

logfileMaxSize, err := strconv.Atoi(*logFileMaxSize)
if err != nil {
panic(fmt.Errorf("error converting arg --log.file-max-size to int - %s", err.Error()))
}

logfileMaxBackups, err := strconv.Atoi(*logFileMaxBackups)
if err != nil {
panic(fmt.Errorf("error converting arg --log.file-max-backups to int - %s", err.Error()))
}

logfileMaxAge, err := strconv.Atoi(*logFileMaxAge)
if err != nil {
panic(fmt.Errorf("error converting arg --log.file-max-age to int - %s", err.Error()))
}

// init logger config
logConfig := logger.LoggerConfig{
LogLevel: *logLevel,
LogMethod: *logMethod,
LogFile: logger.LogFile{
Path: *logFilePath,
MaxSize: *logFileMaxSize,
MaxBackups: *logFileMaxBackups,
MaxAge: *logFileMaxAge,
MaxSize: logfileMaxSize,
MaxBackups: logfileMaxBackups,
MaxAge: logfileMaxAge,
},
VectorEndpoint: *vectorEndpoint,
}
Expand Down

0 comments on commit 4a8a7d2

Please sign in to comment.