Search code examples
prometheusgrafanagrafana-loki

prometheus (or grafana) query to evaluate storage used by grafana loki?


How to calculate the storage used by grafana loki with prometheus query? Is there a specific metric to monitor this?

I have used HELM chart for loki installation as a helm chart, as a result it writes into node's storage. I guess it's using boltdb-shipper.

helm repo add grafana https://grafana.github.io/helm-charts
helm repo update

helm upgrade --install promtail grafana/promtail \
    --create-namespace \
    --namespace monitoring \
    --values cluster/production/charts/loki/values.promtail.yaml 

helm upgrade --install loki grafana/loki \
    --create-namespace \
    --namespace monitoring \
    --values cluster/production/charts/loki/values.loki.yaml 

Solution

  • These metrics can help you:

    # HELP loki_ingester_chunk_size_bytes Distribution of stored chunk sizes (when stored).
    # TYPE loki_ingester_chunk_size_bytes histogram
    loki_ingester_chunk_size_bytes_bucket
    loki_ingester_chunk_size_bytes_sum
    loki_ingester_chunk_size_bytes_count
    # HELP loki_ingester_chunk_stored_bytes_total Total bytes stored in chunks per tenant.
    # TYPE loki_ingester_chunk_stored_bytes_total counter
    loki_ingester_chunk_stored_bytes_total