I'm new to Prometheus and I'm using it in conjunction with Grafana and 
Django. Simple metrics are easy enough to make without knowing much.

Now I'm having trouble with collecting data about files being uploaded. In 
my application the user can upload files up to 50MB so it would be nice
if I could have a graph with the total of each file size. Namely 0.5MB, 
1MB, 2MB, 5MB .. 50MB.

I tried using a histogram like below

```python
uploaded_file_sizes = Histogram(
    'uploaded_file_sizes',
    'Uploaded file size in bytes',
    buckets=(
        10000,    #   10KB
        100000,   #   100KB
        500000,   #   500KB
        1000000,  #   1MB
        5000000,  #   5MB
        10000000,  #   10MB
        25000000,  #   25MB
        50000000,  #   50MB
    )
)
```

However I have no idea on how to get a graph that represents the amount of 
1MB files uploaded for example. Due to the numbers being cumulative,
this seems a bit hard. Currently I made a fast work-around by showing the 
below graph
[image: Screenshot from 2020-06-05 18-19-47.png] <about:invalid#zClosurez>












This requires 5 queries for each specific bucket and the graph is still not 
even intuitive.

How can I avoid this cumulative nature of buckets and instead just show the 
total files that are closest to a file size (so that no overlapping between 
buckets occur)?

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/8914ef09-b42a-4d62-bf90-8cbc380f1b21o%40googlegroups.com.

Reply via email to