Add (Datadog APM) initializer in custom plugin?

@sam I tried that but apparently this particular ddtrace gem expects to be able to run in before_initialize, too. But it doesn’t seem like before_initialize is a valid method in plugin.rb. Are there any other options for a plugin to run earlier in the lifecycle of the app?

Error:

[2020-06-30T15:30:40.348519 #2313] ERROR -- ddtrace: [ddtrace] (/workspace/plugins/discourse-datadog/gems/2.6.2/gems/ddtrace-0.37.0/lib/ddtrace/contrib/patcher.rb:43:in `on_patch_error') Failed to apply Datadog::Contrib::Rails::Patcher patch. Cause: can't modify frozen Array Location: /home/vscode/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/actionpack-6.0.3.1/lib/action_dispatch/middleware/stack.rb:102:in `insert'