Skip to content

Commit

Permalink
fix(exporter): Invalid Warn message
Browse files Browse the repository at this point in the history
Fix WARN message being thrown when using application token and no user is meant to be scrapped
  • Loading branch information
coolapso committed Nov 17, 2024
1 parent 43e1506 commit e4a762f
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions internal/collectors/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,16 @@ func (e *Exporter) handleUserTokens() error {

func (e *Exporter) collectUserMetrics() bool {
if e.Settings.UserToken {
return true
}
if e.Settings.User.Name == "" {
e.Logger.Warn("User token provided, but no user was provided, consider removing the --user.token flag or set a user to monitor. Not scraping user metrics")

if e.Settings.User.Name == "" {
e.Logger.Warn("User token provided, but no user was provided, consider removing the --user.token flag or set a user to monitor. Not scraping user metrics")
return false
}

return false
return true
}


return false
}

Expand Down

0 comments on commit e4a762f

Please sign in to comment.