added optional currencies config

Signed-off-by: Vannarath Poeu <vannarath.poeu@gmail.com>
This commit is contained in:
Vannarath Poeu
2021-08-05 11:55:09 +08:00
parent edcb115530
commit 87ef530efe
6 changed files with 136 additions and 7 deletions
+30
View File
@@ -148,6 +148,36 @@ costInsights:
name: Metric C
```
### Currencies (Optional)
In the `Cost Overview` panel, users can choose from a dropdown of currencies to see costs in, such as Engineers or USD. Currencies must be defined as keys on the `currencies` field. A user-friendly label and unit are **required**. If not set, the `defaultCurrencies` in `currenc.ts` will be used.
A currency without `kind` is reserved to calculate cost for `engineers`. There should only be one currency without `kind`.
```yaml
## ./app-config.yaml
costInsights:
engineerCost: 200000
products:
productA:
name: Some Cloud Product
icon: storage
productB:
name: Some Other Cloud Product
icon: data
currencies:
metricA:
currencyA:
label: Currency A
unit: Unit A
currencyB:
label: Currency B
kind: CURRENCY_B
unit: Unit B
prefix: B
rate: 3.5
```
## Alerts
The CostInsightsApi `getAlerts` method may return any type of alert or recommendation (called collectively "Action Items" in Cost Insights) that implements the [Alert type](https://github.com/backstage/backstage/blob/master/plugins/cost-insights/src/types/Alert.ts). This allows you to deliver any alerts or recommendations specific to your infrastructure or company migrations.