# Custom events for alerting from OpenTelemetry

**URL:** <https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402>\
**Category:** OpenTelemetry\
**Tags:** opentelemetry, anomaly-detection, problems-classic\
**Created:** [June 7, 2022, 12:42pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402 "2022-06-07T12:42:21Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![khoros\_anonymous](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@khoros\_anonymous](https://community.dynatrace.com/u/khoros_anonymous)\
**Post date:** [June 7, 2022, 12:42pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/1 "2022-06-07T12:42:21Z")

</div>

Hello,

I would like to know if there is a possibility to use from&nbsp;&nbsp;OpenTelemetry traces\>ConfigurationData.find\>Timing section to create Custom events for alerting.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [June 7, 2022, 7:50pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/2 "2022-06-07T19:50:35Z")

</div>

Hi, sp

Try to use the&nbsp;builtin:span\_responsetime metric, and split the dimension by span.kind, filtering by the resulting span service from your ingestion.

Check if this fit for your need.

 ![Screen Shot 2022-06-07 at 16.48.28.png](https://global.discourse-cdn.com/dynatrace/original/2X/8/81a42ead2f086f387ffa678b658729198e4d78c1.png)

 ![Screen Shot 2022-06-07 at 16.48.11.png](https://global.discourse-cdn.com/dynatrace/original/3X/2/4/24e06f7c96b509440ddafb5a2c57cdf3f3732ebb.png)

---

<div class="post-metadata">

**Author:** ![khoros\_anonymous](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@khoros\_anonymous](https://community.dynatrace.com/u/khoros_anonymous)\
**Post date:** [June 7, 2022, 8:54pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/3 "2022-06-07T20:54:26Z")

</div>

Hi,&nbsp; in code for metric, you have spin.kind. And in the first screen health controller index. This means that you set span kind for&nbsp;health controller index? I cannot relate both screens together. However very insightful for me at first place.

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [June 7, 2022, 9:12pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/4 "2022-06-07T21:12:37Z")

</div>

HealthController#index is the trace name, indeed you will not be able to use it as a filter for the metric monitoring, but you can monitor the span service where this trace is associated with, and then, the monitoring will be done on all the traces.

---

<div class="post-metadata">

**Author:** ![khoros\_anonymous](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@khoros\_anonymous](https://community.dynatrace.com/u/khoros_anonymous)\
**Post date:** [June 7, 2022, 9:21pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/5 "2022-06-07T21:21:04Z")

</div>

I wrote the following but got no response:

builtin:span\_responsetime:filter(and(in(“dt.entity.span:service”,entitySelector(“type(span:service),entityId(~“SERVICE-A0248DA9AF8D0000~”)”)))):splitBy(“span.kind”):avg:auto:sort(value(avg,descending)):limit(100)

I assume from my span: kind is by me&nbsp; “client”. And Operation is “ConfigurationData.find”, (where this appears by me as “HealthController#index”&nbsp;in your case) .

And by my app, only trace from&nbsp;OpenTelemetry is integrated and nothing more. If other steps should be done to get back entries from this query?

Plus: pure “builtin:span\_responsetime” does not work, as well, any idea, what could be the reason?

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [June 8, 2022, 3:04pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/6 "2022-06-08T15:04:42Z")

</div>

How are you instrumenting the OpenTelemetry to get the ingested traces?

If you are using the OT instrumentation, you should see a service span type on your service list… but if you look closer, they are not services, but Custom devices.

 ![Screen Shot 2022-06-08 at 11.55.10.png](https://global.discourse-cdn.com/dynatrace/original/2X/0/071dd7c9352b982ae2adf44eedaf33250ffee3c2.png)

This was added to the SaaS version 1.238,&nbsp;[https://www.dynatrace.com/support/help/shortlink/release-notes-saas-sprint-238#services-for-opentelemetry-traces-ingested-via-the-trace-ingest-api](https://www.dynatrace.com/support/help/shortlink/release-notes-saas-sprint-238#services-for-opentelemetry-traces-ingested-via-the-trace-ingest-api)

not sure about Managed (found nothing on release notes)

So, if you are seeing those span services on your env, I suggest to try the Explore Data on Build mode, instead code, to make things easy.

 ![Screen Shot 2022-06-08 at 12.02.27.png](https://global.discourse-cdn.com/dynatrace/original/3X/b/e/be1ad3e2c23055b6b20851e1966cf911c5a92625.png)

Or do this, to make even easier:

 ![Screen Shot 2022-06-08 at 12.03.05.png](https://global.discourse-cdn.com/dynatrace/original/2X/1/1738a252807791f3611a1360e82e3a841c5fd0ca.png)

---

<div class="post-metadata">

**Author:** ![khoros\_anonymous](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@khoros\_anonymous](https://community.dynatrace.com/u/khoros_anonymous)\
**Post date:** [June 8, 2022, 3:23pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/7 "2022-06-08T15:23:23Z")

</div>

> **[Getting Started by Example](https://opentelemetry.io/docs/languages/go/getting-started/)**
>
> Get telemetry for your app in less than 5 minutes!

applied this approach here. Instrumenting trace. and under services don’t have span service in UI..

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [June 8, 2022, 4:29pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/8 "2022-06-08T16:29:43Z")

</div>

What is the version of your Dynatrace tenant? Is it SaaS or Managed?

---

<div class="post-metadata">

**Author:** ![khoros\_anonymous](https://avatars.discourse-cdn.com/v4/letter/k/f9ae1b/32.png) [@khoros\_anonymous](https://community.dynatrace.com/u/khoros_anonymous)\
**Post date:** [June 9, 2022, 11:49am UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/9 "2022-06-09T11:49:34Z")

</div>

1.236.119.20220321-160129 and is managed

---

<div class="post-metadata">

**Author:** ![dannemca](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dannemca/32/7215_2.png) [@dannemca](https://community.dynatrace.com/u/dannemca)\
**Post date:** [June 9, 2022, 7:50pm UTC](https://community.dynatrace.com/t/custom-events-for-alerting-from-opentelemetry/35402/10 "2022-06-09T19:50:32Z")

</div>

The span services were introduced on version 1.238 (SaaS), not sure about Managed.

You can try to update the version to get it automatically or define your own manually.

> **[Define custom topology](https://docs.dynatrace.com/docs/ingest-from/extend-dynatrace/extend-topology/custom-topology)**
>
> Learn how to create a custom topology model that's suited to your telemetry data.

Here are the rules for the span services that is created since 1.238 version:

 ![Screen Shot 2022-06-09 at 16.50.00.png](https://global.discourse-cdn.com/dynatrace/original/3X/a/1/a140f6a660a800c7a5aee60c0deabe429c138adc.png)

 ![Screen Shot 2022-06-09 at 16.47.33.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/7/177a2e89435ac653e29daf96ec408219674849fb.png)
