Invalid fsstat used/free disk space docker wsl2
- Dominant language
- Go
- Stars
- 12.7k
- Forks
- 5k
- Avg merge
- 2d 15m
- Merged PRs (30d)
- 385
Description
Metricbeat reports invalid free size.
Total size reported is total disk size (correct), but used size seems to be only docker related files, not rest of files on disk.
So the resulting free space is very large, but in reality, only ~70GB are free.
ES document:
```
Discover
metricbeat-7.9.3-2020.11.25-000001#mULvAHYBYfcEbWf2DZ1R
{
"_index": "metricbeat-7.9.3-2020.11.25-000001",
"_type": "_doc",
"_id": "mULvAHYBYfcEbWf2DZ1R",
"_score": 1,
"_source": {
"@timestamp": "2020-11-25T19:43:54.215Z",
"event": {
"duration": 280200,
"dataset": "system.fsstat",
"module": "system"
},
"metricset": {
"name": "fsstat",
"period": 60000
},
"service": {
"type": "system"
},
"system": {
"fsstat": {
"total_files": 16777216,
"total_size": {
"total": 269490393088,
"free": 263948574720,
"used": 5541818368
},
"count": 1
}
},
"ecs": {
"version": "1.5.0"
},
"host": {
"name": "49dfe54a424c"
},
"agent": {
"type": "metricbeat",
"version": "7.9.3",
"hostname": "49dfe54a424c",
"ephemeral_id": "5565dcf7-e371-4655-8d8c-ae5026fa9cc7",
"id": "0d988131-c303-49c5-9e64-ed8caa5ed884",
"name": "49dfe54a424c"
}
},
"fields": {
"@timestamp": [
"2020-11-25T19:43:54.215Z"
]
}
}
```
metricbeat.yml:
```
output.elasticsearch:
hosts: ["http://elasticsearch:9200"]
metricbeat.modules:
- module: docker
metricsets: ["container", "cpu", "diskio", "memory", "info", "network"]
cpu.metrics: ["normalized_percentages"]
hosts: ["unix:///var/run/docker.sock"]
period: 60s
- module: system
metricsets:
- cpu
- memory
- network
- uptime
- diskio
- fsstat
period: 60s
cpu.metrics: ["normalized_percentages"]
metricbeat.autodiscover:
providers:
- type: docker
hints.enabled: true
```
docker service:
```
metricbeat:
image: store/elastic/metricbeat:7.9.3
restart: unless-stopped
mem_limit: 64m
volumes:
- metricbeat-data:/usr/share/metricbeat/data
- ./config/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml:ro
- /var/run/docker.sock:/var/run/docker.sock:ro
user: root #docker sock access
cap_add:
- SYS_PTRACE
- DAC_READ_SEARCH
labels:
app: metricbeat
command: --strict.perms=false -e
```
For confirmed bugs, please report:
- Version: 7.9.3
- Operating System: docker windows 2.5.0.1
- Discuss Forum URL:
- Steps to Reproduce:
Contributor guide
Research direction
The issue names no source file or test; start with the system module's fsstat metricset and reproduce the report using the provided Metricbeat, Docker, and WSL2 configuration. Compare the reported total, used, and free values with the actual disk, and consider the issue done when fsstat reports correct whole-disk usage or the limitation is documented.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, go
- Domain
- observability
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100