Search code examples
dockerprometheus

Where does Prometheus store metrics data (in container)?


I am searching for the ./data folder described in Storage section pf Prometheus Documentation. I run a basic Prometheus Docker container prom/prometheus on Kubernetes. If I execute a shell inside the container, the working directory is /prometheus and it contains the wal directory, but it does not have the structure mentioned in the documentation and I can not find any metric data.

Where are the metrics stored which I can query over Prometheus GUI?


Solution

  • I have figured out the problem now. The structure, which was mentioned in the documentation, need several hours to build up.

    ./data
    ├── 01BKGTZQ1HHWHV8FBJXW1Y3W0K
    │   └── meta.json
    ├── 01BKGV7JC0RY8A6MACW02A2PJD
    │   ├── chunks
    │   │   └── 000001
    │   ├── tombstones
    │   ├── index
    │   └── meta.json
    └── wal
        ├── 00000002
        └── checkpoint.000001
    

    The first of those folders starting with 01... appeared after 4 hours. The next one took an other 2 hours. It seems to vary according to the amount of metrics you are pulling.


    Sidenote: As nischay goyal wrote in his answer, Prometheus TSDB can not be decoded. You can query the Prometheus API with a script to export metrics.