PromQL - How to calculate percentage from these 2 metrics for time series panel

Hi, I just started to learn Grafana/PromQL last week. I’m not sure why this isn’t working, so if anyone could help I’d appreciate it!

Grafana version: 9.2
Prometheus version: 2.39.1

  • What: Trying to create a time series chart to show usage percentage (threads used vs threads max) over time. Both metrics are of type Gauge.
  • How: Using PromQL to divide threads used metric / threads max metric: javamelody_threads_count / javamelody_tomcat_threads_max. This doesn’t work, I get no data. If I use avg(javamelody_threads_count) / avg(javamelody_tomcat_threads_max) it works but I want to divide raw values (non calculated).
  • What happened: No data
  • Expected: percentage values calculated for time range show up in a time series graph
  • Any errors: None, just no data

Here is a screenshot showing both values. My goal is to divide the two to calculate the percentage and show that in the graph instead.