# Can a OneAgent plugin be used to create custom events?

**URL:** <https://community.dynatrace.com/t/can-a-oneagent-plugin-be-used-to-create-custom-events/10947>\
**Category:** Extensions\
**Tags:** oneagent, extensions\
**Created:** [February 6, 2018, 11:56pm UTC](https://community.dynatrace.com/t/can-a-oneagent-plugin-be-used-to-create-custom-events/10947 "2018-02-06T23:56:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![r\_weber](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/r_weber/32/24884_2.png) [@r\_weber](https://community.dynatrace.com/u/r_weber)\
**Post date:** [February 6, 2018, 11:56pm UTC](https://community.dynatrace.com/t/can-a-oneagent-plugin-be-used-to-create-custom-events/10947/1 "2018-02-06T23:56:50Z")

</div>

The documentation only mentions metrics, but can a OneAgent plugin also be used to e.g. create custom error events?

---

<div class="post-metadata">

**Author:** ![wolfgang\_beer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/wolfgang_beer/32/14717_2.png) [@wolfgang\_beer](https://community.dynatrace.com/u/wolfgang_beer)\
**Post date:** [February 15, 2018, 8:18am UTC](https://community.dynatrace.com/t/can-a-oneagent-plugin-be-used-to-create-custom-events/10947/2 "2018-02-15T08:18:05Z")

</div>

Sure you can define an alerting section within the plugin json definition file in order to raise custom events for plugin metrics. Those events take part within the Dynatrace AI correlation and causation process.

See my blog post here:

> **[What is IT automation?](https://www.dynatrace.com/knowledge-base/it-automation/)**
>
> Learn how IT automation works, its potential pros and cons, and why taking an observability platform approach is essential.

---

<div class="post-metadata">

**Author:** ![Julius\_Loman](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/julius_loman/32/51_2.png) [@Julius\_Loman](https://community.dynatrace.com/u/Julius_Loman)\
**Post date:** [February 15, 2018, 12:14pm UTC](https://community.dynatrace.com/t/can-a-oneagent-plugin-be-used-to-create-custom-events/10947/3 "2018-02-15T12:14:30Z")

</div>

In addition to @Wolfgang B. answer, I think it should be possible to use the Event reporting API available in OneAgent SDK directly from plugin code. See the package ruxit.api.events. Example code is in the notifications\_openstack\_plugin.py, but I’m not sure if this is supported or not.  
Based on what I’ve seen, you should be able to send events of specific types (not alerts) that are attached to entities. But I think this API is not yet supported.
