Extracting label value

I have this metric in Prometheus
requests_total{instance=“11.213.51.73:60001”, pod_name=“6d54b97f5c-hv7vd”, response_length=“0”, response_time=“1000”, status=“Ok”} val
And I need to calculate mean and median of response_time in 5m sliding window
sum response_time * val / sum val
Could you please help me