diff --git a/README.md b/README.md index d14bb7e..8828004 100644 --- a/README.md +++ b/README.md @@ -61,7 +61,6 @@ tests locally: ## TODOs -- Add SlapbirdAPM back in - Do I need `SUM` for `by_id()`? ## AGPL-3.0+ANTIFA compliance 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/example_post_text.conf b/example_post_text.conf index 486dfcb..7247f46 100644 --- a/example_post_text.conf +++ b/example_post_text.conf @@ -6,6 +6,7 @@ body_max_length => 8_000, version => 'Feb 11 2025', secrets => ['t0p_s3cr3t'], + slapbird_api_key => 'AyyLmao39b4eb99de26d437633e49555', development => { pg_string => 'postgresql://post_text:t0p_s3cr3t@127.0.0.1/post_text' diff --git a/lib/PostText.pm b/lib/PostText.pm index acfd523..b1e748e 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'})