phsmith / rundeck_exporter

Rundeck Metrics Exporter
GNU General Public License v3.0
58 stars 25 forks source link

rundeck_project_execution_duration_seconds report wrong values #65

Closed kaplanben closed 1 year ago

kaplanben commented 1 year ago

We're seeing strange numbers in rundeck_project_execution_duration_seconds metrics and we're not sure why:

# HELP rundeck_project_execution_duration_seconds Rundeck Project ProjectName Execution Duration
# TYPE rundeck_project_execution_duration_seconds gauge
rundeck_project_execution_duration_seconds{execution_id="1111",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_a",job_name="job_a",project_name="project_a",user="user_a"} 985109.0
rundeck_project_execution_duration_seconds{execution_id="1110",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_a",job_name="job_a",project_name="project_a",user="user_a"} 985109.0
rundeck_project_execution_duration_seconds{execution_id="1109",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_a",job_name="job_a",project_name="project_a",user="user_a"} 985109.0
rundeck_project_execution_duration_seconds{execution_id="1108",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_b",job_name="job_b",project_name="project_a",user="admin"} 1202.0
rundeck_project_execution_duration_seconds{execution_id="1107",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_a",job_name="job_a",project_name="project_a",user="user_a"} 985109.0
rundeck_project_execution_duration_seconds{execution_id="1106",execution_type="user",instance_address="localhost:4440",job_group="****",job_id="id_c",job_name="job_c",project_name="project_a",user="user_b"} 1.269357e+06

what's interesting is that 985109.0 appear multiple times.

Any ideas?

Thanks!

phsmith commented 1 year ago

Hey @kaplanben, thanks for your report. The exporter is currently showing the averageDuration attribute from Rundeck jobs, and it really isn't the right attribute to measure the job execution duration. I'll take a look at that issue as soon as possible!

phsmith commented 1 year ago

Hey @kaplanben, can you try the latest release (2.5.1)?

kaplanben commented 1 year ago

Wow 😄 lightning fast! It works 👍

one suggestion I have is to rename the metric since the value is in milliseconds and not second e.g. # HELP rundeck_project_execution_duration_milliseconds Rundeck Project ProjectName Execution Duration in ms

Thank you @phsmith!

phsmith commented 1 year ago

Awesome! :smiley:

Yeah, your suggestion is completely right, but Prometheus has some name conventions that encourages the usage of base units in the metrics name (seconds, bytes, meters, etc...). So in that case, it's better to transform the milliseconds value into seconds.

phsmith commented 1 year ago

I've just released the version 2.5.2. Now rundeck_project_execution_duration_milliseconds going to return the values in seconds! :+1: