So I created a python file named metrics.py and initialized the following metrics.
metrics.py
from prometheus_client import Counter, Histogram
walks_started = Counter('walks_started', 'number of walks started')
walk_distance = Histogram('walk_distance', 'distribution of distance walked')
and in views.py
from .metrics import walk_distance, walks_started
@walk_distance.time()
def request(self):
walks_started.inc()
--------
But in /metrics page I see a zero for all the buckets and also for the counter.
Regards,
Arijit