[BUG] Metric backmon_backup_file_young_count reports incorrectly
- Dominant language
- Go
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Given the following definitions file
```yaml
'./pfsense-backup':
defaults:
schedule: 05 04 * * *
purge: false
files:
'%Y%M%D-config.xml':
alias: pfSense
retention-count: 14
retention-age: 14d
'./freeipa-backup/{{date}}':
fuse:
- 'date'
defaults:
schedule: 30 21 * * *
purge: false
files:
'header':
retention-count: 14
retention-age: 14d
'ipa-full.tar':
retention-count: 14
retention-age: 14d
```
Backmon reports the following metrics:
```
# HELP backmon_backup_file_young_count The amount of backup files in this group that are younger than the maximum age (file_age_aim_seconds).
# TYPE backmon_backup_file_young_count gauge
backmon_backup_file_young_count{dir="./freeipa-backup/{{date}}",disk="ws3-backup",file="header",group="freeipa-backup/{{date}}"} 0
backmon_backup_file_young_count{dir="./freeipa-backup/{{date}}",disk="ws3-backup",file="ipa-full.tar",group="freeipa-backup/{{date}}"} 0
backmon_backup_file_young_count{dir="./pfsense-backup",disk="ws3-backup",file="pfSense",group="pfsense-backup"} 0
```
However, since _retention-age_ is set, the metric should report properly (value `0` for each metric is probably wrong).
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the reported metrics with the YAML definitions in the issue, then trace the backmon code that computes backmon_backup_file_young_count and applies retention-age. Done means the metric reports the correct young-file count for each listed backup file, with coverage for the provided configuration.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, prometheus
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100