Browse Source

Update Azure Rate Card Log (#3108)

Signed-off-by: Nik Willwerth <nwillwerth@kubecost.com>
nik-kc 1 year ago
parent
commit
43d17f2c2a
1 changed files with 9 additions and 1 deletions
  1. 9 1
      pkg/cloud/azure/provider.go

+ 9 - 1
pkg/cloud/azure/provider.go

@@ -849,8 +849,16 @@ func (az *Azure) DownloadPricingData() error {
 
 	rateCardFilter := fmt.Sprintf("OfferDurableId eq '%s' and Currency eq '%s' and Locale eq 'en-US' and RegionInfo eq '%s'", config.AzureOfferDurableID, config.CurrencyCode, config.AzureBillingRegion)
 
+	// create a preparer (the same way rcClient.Get() does) so that we can log the azureRateCard URL
 	log.Infof("Using azureRateCard query %s", rateCardFilter)
-	log.Debugf("Using azureRateCard URI %s", rcClient.BaseURI)
+	rcPreparer, err := rcClient.GetPreparer(context.TODO(), rateCardFilter)
+	if err != nil {
+		// this isn't an error that necessitates a return, as we only need the preparer for an informational log
+		log.Infof("Failed to get azureRateCard URL: %s", err)
+	} else {
+		log.Infof("Using azureRateCard URL %s", rcPreparer.URL.String())
+	}
+
 	// rate-card client is old, it can hang indefinitely in some cases
 	// this happens on the main thread, so it may block the whole app
 	// there is can be a better way to set timeout for the client