# 在自定义插件中添加 (Datadog APM) 初始化器？

**URL:** <https://meta.discourse.org/t/add-datadog-apm-initializer-in-custom-plugin/155804>\
**Category:** Development\
**Created:** [2020 年6 月 24 日 12:52 UTC](https://meta.discourse.org/t/add-datadog-apm-initializer-in-custom-plugin/155804 "2020-06-24T12:52:17Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

作者： ![raph](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/raph/32/184924_2.png) [@raph](https://meta.discourse.org/u/raph)\
发布日期： [2020 年6 月 30 日 15:44 UTC](https://meta.discourse.org/t/add-datadog-apm-initializer-in-custom-plugin/155804/5 "2020-06-30T15:44:00Z")

</div>

我接下来的步骤将是不使用由该 gem 的“补丁器”自动应用的魔法化插桩，而是将部分实际的插桩逻辑直接集成到插件本身，就像你在 `discourse-prometheus` 中所做的那样。我想，考虑到要接入 Discourse 的一些具体特性，这样做也是合理的。我只是希望还有某种我尚未发现的利用这些魔法的方法。

---

_[View the full topic](https://meta.discourse.org/t/add-datadog-apm-initializer-in-custom-plugin/155804)._
