From e31dbcc9da0853052073285cb384a4ac2f3f8887 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Fri, 9 Aug 2024 21:13:02 -0400 Subject: [PATCH] Implement API key for SlapbirdAPM --- cpanfile | 1 + lib/PostText.pm | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/cpanfile b/cpanfile index 9cbd532..b8756a3 100644 --- a/cpanfile +++ b/cpanfile @@ -7,3 +7,4 @@ requires 'XML::RSS'; requires 'Text::Markdown'; requires 'HTML::Restrict'; requires 'Roman::Unicode'; +requires 'SlapbirdAPM::Agent::Mojo'; diff --git a/lib/PostText.pm b/lib/PostText.pm index c117e82..a813630 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -19,6 +19,12 @@ sub startup($self) { $self->plugin('Config'); $self->plugin('TagHelpers::Pagination'); + # Alpha testing Slapbird APM + if (my $slapbirdapm_api_key = $self->config->{'slapbirdapm_api_key'}) { + $self->plugin('SlapbirdAPM', key => $slapbirdapm_api_key) + if $self->mode eq 'production' + } + # Helpers $self->helper(pg => sub ($c) { state $pg = Mojo::Pg->new($c->config->{$self->mode}{'pg_string'})