1 from prometheus_client import start_http_server, Histogram
5 function_exec = Histogram('function_exec_time',
6 'Time spent processing a function',
10 if (random.random() < 0.02):
14 start_http_server(9100)
17 start_time = time.time()
19 function_exec.labels(func_name="func").observe(time.time() - start_time)