summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authorMars <mfogels@gmail.com>2018-08-16 23:39:19 +0200
committerDylan William Hardison <dylan@hardison.net>2018-08-16 23:39:19 +0200
commitae9885389d3ce428f24e0352814b70b099fadb95 (patch)
treefdbc45867bc5987faa640db7178f108dd574b7ad /Bugzilla.pm
parentec87e5310ad038abe4b2b329897638d866bf549a (diff)
downloadbugzilla-ae9885389d3ce428f24e0352814b70b099fadb95.tar.gz
bugzilla-ae9885389d3ce428f24e0352814b70b099fadb95.tar.xz
Bug 1480878 - Monitor the health of Push connector job processing
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm21
1 files changed, 21 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 5e48d21f4..f26819d93 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -780,6 +780,27 @@ sub memcached {
return request_cache->{memcached} ||= Bugzilla::Memcached->_new();
}
+# Connector to the Datadog metrics collection daemon.
+sub datadog {
+ my ($class, $namespace) = @_;
+ my $host = $class->localconfig->{datadog_host};
+ my $port = $class->localconfig->{datadog_port};
+
+ $namespace //= '';
+
+ if ($class->has_feature('datadog') && $host) {
+ require DataDog::DogStatsd;
+ return request_cache->{datadog}{$namespace} //= DataDog::DogStatsd->new(
+ host => $host,
+ port => $port,
+ namespace => $namespace ? "$namespace." : '',
+ );
+ }
+ else {
+ return undef;
+ }
+}
+
sub elastic {
my ($class) = @_;
$class->process_cache->{elastic} //= Bugzilla::Elastic->new();