-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add reservation metics and exportType for costs #87
Conversation
Added data in ISO format as label
update deps
Feat/export type
you're using the old deprecated and not maintained azure-sdk-for-go ( |
i will check that, thanks for your feedback |
@mblaschke I fix go module "azure-sdk-for-go" now it's ok |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i've refactored and cleanup some code, but still have some questions.
(sorry for the delay, had some private trouble in the last weeks/months)
startDate := formattedDate | ||
endDate := time.Now().Format("2006-01-02") | ||
|
||
clientFactory, err := armconsumption.NewClientFactory("<subscription-id>", AzureClient.GetCred(), AzureClient.NewArmClientOptions()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't <subscription-id>
not set to the subscription id? and loop trough every subscription id in the collect function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thanx for your return,
It is surprising, but in fact the value should not be defined because this metrics_azurerm_reservation.go is intended to be used from an MCA tenant (which operates by billing profile rather than by subscription). Therefore, leaving "" works well. We could rename the field but not set it to nil.
metrics_azurerm_resources.go
Outdated
@@ -105,21 +111,69 @@ func (m *MetricsCollectorAzureRmResources) collectAzureResources(subscription *a | |||
|
|||
resourceMetric := m.Collector.GetMetricList("resource") | |||
|
|||
// Get azure disk detail |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i'm currently not sure if we should add disks to the resourcemanager exporter.
This might be a better solution to use the azure-resourcegraph-exporter when you can use a ResourceGraph Kusto query to get every list you want.
Otherwise i would have to add every resource to this exporter and that's the reason most of the stuff was removed from this exporter. the resourcegraph queries are more flexible than this exporter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok for this part i understand, ca we ignore this modifications on this file ?
Quality Gate passedIssues Measures |
Add metrics_azurerm_reservation.go :
metrics_azurerm_costs.go :