Boavizta / cloud-scanner

📡 Get Boavizta impact data for your aws cloud account usage.
GNU Affero General Public License v3.0
34 stars 8 forks source link

Value returned for boavizta_duration_of_use_hours metric is always zero #206

Closed demeringo closed 1 year ago

demeringo commented 1 year ago

Bug description

boavizta_duration_of_use_hours metric always returns a zero value.

Although it seems that hour use time is well taken into account during other impact calculation, so this bug does not falsify the results themselves but could harm in later display.

To Reproduce

Exemple after docker-compose up

access http://localhost:8000/metrics?aws_region=eu-west-3

# HELP boavizta_duration_of_use_hours Use duration considered to estimate impacts.
# TYPE boavizta_duration_of_use_hours gauge
boavizta_duration_of_use_hours{awsregion="eu-west-3",country="FRA"} 0.0

Expected behavior

JSON OUTPUT

Additional context

demeringo commented 1 year ago

Seems like we miss to pass the value when building an ImpactsSummary and it is returned as 0 due to the default trait.