Add new queue metrics with job tags#73
Conversation
There was a problem hiding this comment.
It doesn't seem like this PR does what you want, see the comment I've added below.
Also I don't think modifying in place those jenkins.queue metrics will work. Ideally we would add new jenkins.queue.size_per_job metrics which would give visibility from Datadog into which jobs are filling the queue.
Last but not least, let's add a test for this.
| if (task instanceof Run){ | ||
| job_name = ((Run)task).getParent().getFullName(); | ||
| } else { | ||
| job_name = task.getFullDisplayName(); |
There was a problem hiding this comment.
I think we should be more careful here. I'd rather not tag (or actually set the job_name to unknown) rather than tagging by something we have no control on.
Task may be extended by any plugin, and the full display name can totally be a unique identifier which will create context explosion.
There was a problem hiding this comment.
That makes sense, we would not want that. I will look into it more
There was a problem hiding this comment.
So, I think checking for Run might also be a problem if this is the case. What do you think about going back to this suggestion: #73 (comment)
There was a problem hiding this comment.
I think that seems like the right approach :)
| Task task = item.task; | ||
| if (task instanceof FreeStyleProject){ | ||
| job_name = task.getFullDisplayName(); | ||
| TagsUtil.addTagToTags(job_tags, "job_name", job_name); |
There was a problem hiding this comment.
Let's add an else clause that adds job_name:unknown. This will make queries better on Datadog
There was a problem hiding this comment.
Good idea, updated!
* Add queue tags * Add try catch * Add queue tag * Remove log changes * Fix style * Update for all tasks * Add tests * Add individual node metrics * Remove dependency * Remove comments * Add getQueue * Change to size * Add more tests * Fix readme typo * Update readme * Fix typo and remove import * Remove uneeded method * Add tags to readme * Use new testing method * Update metric name * Check for freestyle project * Add unknown tag
Requirements for Contributing to this repository
What does this PR do?
Add new queue metrics that have
job_nametags.Description of the Change
Alternate Designs
Possible Drawbacks
Verification Process
Additional Notes
Release Notes
Review checklist (to be filled by reviewers)
changelog/label attached. If applicable it should have thebackward-incompatiblelabel attached.do-not-merge/label attached.kind/andseverity/labels attached at least.