job prometheus endpoint: drop nixname, too variable

This commit is contained in:
Graham Christensen 2019-12-29 16:36:57 -05:00
parent 64cdc3413c
commit d0f1bda0b8
No known key found for this signature in database
GPG key ID: FE918C3A98C1030F

View file

@ -42,23 +42,21 @@ sub prometheus : Chained('job') PathPart('prometheus') Args(0) {
$prometheus->new_counter(
name => "hydra_job_completion_time",
help => "The most recent job's completion time",
labels => [ "project", "jobset", "job", "nixname" ]
labels => [ "project", "jobset", "job" ]
)->labels(
$c->stash->{project}->name,
$c->stash->{jobset}->name,
$c->stash->{job}->name,
$lastBuild->nixname,
)->inc($lastBuild->stoptime);
$prometheus->new_gauge(
name => "hydra_job_failed",
help => "Record if the most recent version of this job failed (1 means failed)",
labels => [ "project", "jobset", "job", "nixname" ]
labels => [ "project", "jobset", "job" ]
)->labels(
$c->stash->{project}->name,
$c->stash->{jobset}->name,
$c->stash->{job}->name,
$lastBuild->nixname,
)->inc($lastBuild->buildstatus > 0);
$c->stash->{'plain'} = { data => $prometheus->render };