@@ -81,8 +81,8 @@ local dailyCostsPerComponent =
8181 + ts.new('Total daily costs per component' )
8282 + ts.panelOptions.withDescription(
8383 |||
84- Components are human friendly groupings of AWS services, as [defined
85- here](https://github.com/2i2c-org/infrastructure/blob/main/helm-charts/ jupyterhub-cost-monitoring/mounted-files/const .py#L11-L20 ).
84+ Components are human- friendly groupings of AWS services, as [defined
85+ here](https://github.com/2i2c-org/jupyterhub-cost-monitoring/blob/6465946221dd0ecdba622bf482db3844e6fb1f06/src/jupyterhub_cost_monitoring/const_cost_aws .py#L11).
8686
8787 ---
8888
@@ -92,19 +92,22 @@ local dailyCostsPerComponent =
9292 - All costs are pure usage costs, and doesn't consider credits etc.
9393 |||
9494 )
95- + ts.queryOptions.withTargets([
96- common.queryComponentTarget
97- {
98- url: 'http://jupyterhub-cost-monitoring.support.svc.cluster.local/total-costs-per-component?from=${__from:date}&to=${__to:date}' ,
99- },
100- ])
95+ + common.tsStylingComponents
96+ + ts.queryOptions.withTargets(common.queryComponentArray)
10197 + ts.queryOptions.withTransformations([
102- ts.queryOptions.transformation.withId('groupingToMatrix' )
98+ ts.queryOptions.transformation.withId('prepareTimeSeries' )
99+ + ts.queryOptions.transformation.withOptions({
100+ "format" : "wide" ,
101+ }),
102+ ts.queryOptions.transformation.withId('organize' )
103103 + ts.queryOptions.transformation.withOptions({
104- columnField: 'Component' ,
105- emptyValue: 'zero' ,
106- rowField: 'Date' ,
107- valueField: 'Cost' ,
104+ "renameByName" : {
105+ "Cost compute" : "compute" ,
106+ "Cost home storage" : "home storage" ,
107+ "Cost object storage" : "object storage" ,
108+ "Cost core" : "core" ,
109+ "Cost networking" : "networking" ,
110+ },
108111 }),
109112 ])
110113;
@@ -116,7 +119,7 @@ local dailyCostsPerComponentAndHub =
116119 + ts.panelOptions.withDescription(
117120 |||
118121 Components are human friendly groupings of AWS services, as [defined
119- here](https://github.com/2i2c-org/infrastructure/blob/main/helm-charts/ jupyterhub-cost-monitoring/mounted-files/const .py#L11-L20 ).
122+ here](https://github.com/2i2c-org/jupyterhub-cost-monitoring/blob/6465946221dd0ecdba622bf482db3844e6fb1f06/src/jupyterhub_cost_monitoring/const_cost_aws .py#L11).
120123
121124 **Note**
122125
@@ -126,21 +129,24 @@ local dailyCostsPerComponentAndHub =
126129 - All costs are pure usage costs, and doesn't consider credits etc.
127130 |||
128131 )
132+ + common.tsStylingComponents
129133 + ts.panelOptions.withRepeat('hub_general' )
130134 + ts.panelOptions.withMaxPerRow(2 )
131- + ts.queryOptions.withTargets([
132- common.queryComponentTarget
133- {
134- url: 'http://jupyterhub-cost-monitoring.support.svc.cluster.local/total-costs-per-component?from=${__from:date}&to=${__to:date}&hub=$hub_general' ,
135- },
136- ])
135+ + ts.queryOptions.withTargets(common.queryComponentHubArray)
137136 + ts.queryOptions.withTransformations([
138- ts.queryOptions.transformation.withId('groupingToMatrix' )
137+ ts.queryOptions.transformation.withId('prepareTimeSeries' )
138+ + ts.queryOptions.transformation.withOptions({
139+ "format" : "wide" ,
140+ }),
141+ ts.queryOptions.transformation.withId('organize' )
139142 + ts.queryOptions.transformation.withOptions({
140- columnField: 'Component' ,
141- emptyValue: 'zero' ,
142- rowField: 'Date' ,
143- valueField: 'Cost' ,
143+ "renameByName" : {
144+ "Cost compute" : "compute" ,
145+ "Cost home storage" : "home storage" ,
146+ "Cost object storage" : "object storage" ,
147+ "Cost core" : "core" ,
148+ "Cost networking" : "networking" ,
149+ },
144150 }),
145151 ])
146152;
0 commit comments