lib/promscrape/discovery/openstack: show expiration time for refreshed OpenStack token in seconds - this is easier to interpret by human

This commit is contained in:
Aliaksandr Valialkin 2020-10-06 11:20:36 +03:00
parent cc08648699
commit 90aa2a8ffd

View file

@ -54,7 +54,7 @@ func (cfg *apiConfig) getFreshAPICredentials() (*apiCredentials, error) {
return nil, fmt.Errorf("cannot refresh OpenStack api token: %w", err)
}
cfg.creds = newCreds
logger.Infof("successfully refreshed OpenStack api token; next expiration: %s", newCreds.expiration)
logger.Infof("successfully refreshed OpenStack api token; expiration: %.3f seconds", time.Until(newCreds.expiration).Seconds())
return newCreds, nil
}