Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: correct spelling and lint warning #1332

Merged
merged 1 commit into from
Oct 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions cmd/exporters/influxdb/influxdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import (

const (
defaultPort = 8086
detaultTimeout = 5
defaultTimeout = 5
defaultAPIVersion = "2"
defaultAPIPrecision = "s"
expectedResponseCode = 204
Expand Down Expand Up @@ -111,6 +111,7 @@ func (e *InfluxDB) Init() error {
}
e.Logger.Debug().Msgf("using api precision [%s]", *precision)

//goland:noinspection HttpUrlsUsage
urlToUSe := "http://" + *addr + ":" + strconv.Itoa(*port)
url = &urlToUSe
e.url = fmt.Sprintf("%s/api/v%s/write?org=%s&bucket=%s&precision=%s",
Expand All @@ -124,15 +125,15 @@ func (e *InfluxDB) Init() error {
e.Logger.Debug().Msg("will use authorization with api token")

// timeout parameter
timeout := time.Duration(detaultTimeout) * time.Second
timeout := time.Duration(defaultTimeout) * time.Second
if ct := e.Params.ClientTimeout; ct != nil {
if t, err := strconv.Atoi(*ct); err == nil {
timeout = time.Duration(t) * time.Second
} else {
e.Logger.Warn().Msgf("invalid client_timeout [%s], using default: %d s", *ct, detaultTimeout)
e.Logger.Warn().Msgf("invalid client_timeout [%s], using default: %d s", *ct, defaultTimeout)
}
} else {
e.Logger.Debug().Msgf("using default client_timeout: %d s", detaultTimeout)
e.Logger.Debug().Msgf("using default client_timeout: %d s", defaultTimeout)
}

e.Logger.Debug().Str("dbEndpoint", dbEndpoint).Str("url", e.url).Msg("")
Expand Down