Skip to content

Commit

Permalink
refactoring cost reporting
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <mblaschke82@gmail.com>
  • Loading branch information
mblaschke committed Jan 14, 2023
1 parent 42a028f commit 14bde41
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 129 deletions.
4 changes: 2 additions & 2 deletions config/opts.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ type (

// costs
Costs struct {
Timeframe []string `long:"costs.timeframe" env:"COSTS_TIMEFRAME" env-delim:" " description:"Timeframe for cost reportings (space delimiter)" default:"MonthToDate" default:"YearToDate"` //nolint:staticcheck
Dimension []string `long:"costs.dimension" env:"COSTS_DIMENSION" env-delim:" " description:"Dimensions for detailed cost metrics (eg 'ResourceGroup','ResourceGroupName','ResourceLocation','ConsumedService','ResourceType','ResourceId','MeterId','BillingMonth','MeterCategory','MeterSubcategory','Meter','AccountName','DepartmentName','SubscriptionId','SubscriptionName','ServiceName','ServiceTier','EnrollmentAccountName','BillingAccountId','ResourceGuid','BillingPeriod','InvoiceNumber','ChargeType','PublisherType','ReservationId','ReservationName','Frequency','PartNumber','CostAllocationRuleName','MarkupRuleName','PricingModel') (space delimiter)" default:"ResourceType" default:"ResourceLocation"` //nolint:staticcheck
Timeframe []string `long:"costs.timeframe" env:"COSTS_TIMEFRAME" env-delim:" " description:"Timeframe for cost reportings (space delimiter)" default:"MonthToDate" default:"YearToDate"` //nolint:staticcheck
Queries []string `long:"costs.query" description:"Cost query in format: 'queryname=dimension' or 'queryname=dimension1,dimension2,dimension3'. Dimensions can be: 'ResourceGroupName','ResourceLocation','ConsumedService','ResourceType','ResourceId','MeterId','BillingMonth','MeterCategory','MeterSubcategory','Meter','AccountName','DepartmentName','SubscriptionId','SubscriptionName','ServiceName','ServiceTier','EnrollmentAccountName','BillingAccountId','ResourceGuid','BillingPeriod','InvoiceNumber','ChargeType','PublisherType','ReservationId','ReservationName','Frequency','PartNumber','CostAllocationRuleName','MarkupRuleName','PricingModel'. Can be specified in env vars as COSTS_QUERY_queryname=Dimensions"`
RequestDelay time.Duration `long:"costs.request.delay" env:"COSTS_REQUEST_DELAY" description:"Delay API requests by this time to avoid ratelimits" default:"10s"`
}

Expand Down

0 comments on commit 14bde41

Please sign in to comment.