Skip to content
This repository has been archived by the owner on Jan 23, 2020. It is now read-only.

Emit counter for completed jobs #33

Closed
jshirley opened this issue Dec 9, 2015 · 7 comments
Closed

Emit counter for completed jobs #33

jshirley opened this issue Dec 9, 2015 · 7 comments
Milestone

Comments

@jshirley
Copy link

jshirley commented Dec 9, 2015

We would like to graph failed jobs, grouped by job, on our Jenkins dashboards. It doesn't look like it's possible to add the count of each event on a dashboard, and looking at other plugins using a count metric is the typical method for doing this.

With a jenkins.job.completed counter, we can use sum and filter accordingly and then add the graph as expected.

We use the service checks for monitors, which are working fine, but we can't add that graph to a dashboard.

@JohnLZeller
Copy link
Contributor

Thanks for the ticket @jshirley :) I'll add this to the list for the next release

@JohnLZeller JohnLZeller added this to the Next milestone Jan 8, 2016
@MadsNielsen
Copy link
Contributor

@JohnLZeller I'm going to have a stab at this one. I looked through the API docs, there isn't a mention of what values 'type' can take ? In the plugin you create a 'gauge' type metric. Is there a difference between the 'gauge' type and the 'count' type?

    // Build metric
    JSONObject metric = new JSONObject();
    metric.put("metric", metricName);
    metric.put("points", points);
    metric.put("type", "gauge");
    metric.put("host", builddata.get("hostname"));
    metric.put("tags", assembleTags(builddata));

So...is the way to simply emit a similar metric with the 'jenkins.job.completed' and simply just assign it the value '1' so that graphs can summarize?

@MadsNielsen
Copy link
Contributor

@JohnLZeller how would you prefer i deliver this one. My change requires the features from #38. Would you be ok with a new pull request that bases itself off the new feature i added?

I could also just create a new commit on the existing pull request, it would mean that the pull request attempts to implement 2 features...i Guess that's ok? We can always fixup the history of the changes in my fork before they're merged into the official repository.

@MadsNielsen
Copy link
Contributor

Okay @JohnLZeller I've added my initial suggestion here: No pull request yet...i did a bit of refactoring in this commit: https://github.com/Praqma/jenkins-datadog-plugin/commit/f3bb89655e1ed72ef4288fde46e44d46f22b2128

I've created a small object for a metric emission..i hope i understood how Datadog works. Pretty nice to play around with the UI atleast. Very easy to setup a simple dashboard, With this commit i can do it like this: A counter that counts failed jobs and a counter that counts sucessful jobs.

example

@JohnLZeller
Copy link
Contributor

Hey @MadsNielsen! Go ahead and open a PR. I'm gonna merge the stuff from #38 after your next commits.

@JohnLZeller
Copy link
Contributor

Added with #43

@MadsNielsen
Copy link
Contributor

Fine with me😀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants