export a /prometheus endpoint
[?]
Sep 24, 2019, 8:34 PM
TF5HAPRDV6USGRKEEDIV263YZRUWGC4SKP3RXCBBVT7FEBGT5XFQCDependencies
- [2]
JLQN6QYHRevert "Remove the global channel" - [3]
ICYJNJWHRevert "Move build logic for the core hydra package into its own default.nix." - [4]
HPGWVEFKAdd 'readonly_ips' option, to allow readonly access for certain IPs when 'private' option is enabled. - [*]
T4LLYESZ* Nix expression for building Hydra. - [*]
J5UVLXOK* Start of a basic Catalyst web interface. - [*]
LBNVQXUB* Build the /build stuff in a separate controller. - [*]
SZYDW2DGhydra: added some user admin - [*]
SMM4HQTP* Put actions related to builds under /build (e.g. /log/<buildid>
Change contents
- edit in release.nix at line 102
NetPrometheus - edit in src/lib/Hydra/Controller/Root.pm at line 9
use Hydra::View::TT; - edit in src/lib/Hydra/Controller/Root.pm at line 17[4.29][10.0]
use Net::Prometheus; - edit in src/lib/Hydra/Controller/Root.pm at line 205
sub prometheus :Local Args(0) {my ($self, $c) = @_;my $machines = getMachines; - edit in src/lib/Hydra/Controller/Root.pm at line 209
my $client = Net::Prometheus->new;my $duration = $client->new_histogram(name => "hydra_machine_build_duration",help => "How long builds are taking per server. Note: counts are gauges, NOT counters.",labels => [ "machine" ],buckets => [60,600,1800,3600,7200,21600,43200,86400,172800,259200,345600,518400,604800,691200]);my $steps = dbh($c)->selectall_arrayref("select machine, s.starttime as starttime " ."from BuildSteps s join Builds b on s.build = b.id " ."where busy != 0 order by machine, stepnr",{ Slice => {} });foreach my $step (@$steps) {my $name = $step->{machine} ? Hydra::View::TT->stripSSHUser(undef, $step->{machine}) : "";$name = "localhost" unless $name;$duration->labels($name)->observe(time - $step->{starttime});}$c->stash->{'plain'} = { data => $client->render };$c->forward('Hydra::View::Plain');}