# Create Custom Metric from missing log entries

**URL:** <https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370>\
**Category:** Logs\
**Tags:** log-ingestion, dynatrace-managed, charts, logs\
**Created:** [February 20, 2025, 5:20pm UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370 "2025-02-20T17:20:36Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![detk72](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@detk72](https://community.dynatrace.com/u/detk72)\
**Post date:** [February 20, 2025, 5:20pm UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370/1 "2025-02-20T17:20:36Z")

</div>

Hi,

I created a metric “cluster-availability” using Log Monitoring - Metric extraction (mointoring availability of a JDBC database by checking the log entries which are ingested by custom extension/[SQL data source](https://docs.dynatrace.com/docs/ingest-from/extensions20/data-sources/sql)). In this way I get the value of availability which I can use in chart.

I want to create a metric that shows the **unavailability** &nbsp;which would concern&nbsp;the missing datapoints of&nbsp;metric “cluster-availability”

How can I do this?

Thank you very much for your help.

---

<div class="post-metadata">

**Author:** ![marco\_irmer](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/marco_irmer/32/3038_2.png) [@marco\_irmer](https://community.dynatrace.com/u/marco_irmer)\
**Post date:** [March 7, 2025, 11:42pm UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370/2 "2025-03-07T23:42:30Z")

</div>

What does your metric data look like during times of unavailability? Are you getting ‘null’ values or something else?

---

<div class="post-metadata">

**Author:** ![detk72](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@detk72](https://community.dynatrace.com/u/detk72)\
**Post date:** [March 10, 2025, 8:41am UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370/3 "2025-03-10T08:41:50Z")

</div>

Hi there,

Thanks for your reply. During times of unavailability it’s lacking datapoints, since in this case datapoints are only created when the cluster is available. I could use the **default(0,always)**

```auto
db_cluster.avail:filter(eq("dt.entity.custom:my_db_cluster",CUSTOM_DEVICE-XXXX)):splitBy("dt.entity.custom:my_db_cluster"):<strong>default(0,always)

</strong>

```

So I could set “0” for the missing datapoint.

Thanks for your support.

---

<div class="post-metadata">

**Author:** ![PacoPorro](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/pacoporro/32/36087_2.png) [@PacoPorro](https://community.dynatrace.com/u/PacoPorro)\
**Post date:** [March 10, 2025, 11:50am UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370/4 "2025-03-10T11:50:10Z")

</div>

You can use&nbsp;Missing data alert parameter.

> **[Anomaly detection configuration](https://docs.dynatrace.com/docs/dynatrace-intelligence/anomaly-detection/anomaly-detection-configuration)**
>
> How to set up an alert for missing measurements.

---

<div class="post-metadata">

**Author:** ![detk72](https://avatars.discourse-cdn.com/v4/letter/d/4bbf92/32.png) [@detk72](https://community.dynatrace.com/u/detk72)\
**Post date:** [March 10, 2025, 2:14pm UTC](https://community.dynatrace.com/t/create-custom-metric-from-missing-log-entries/50370/5 "2025-03-10T14:14:01Z")

</div>

Hi,

Thanks for your reply. The anomaly detection/missing-data is in place. However additonally the requirement is to display the unavailbity within a chart oder dashboard.

Kind regards,
