# Fetch the HTTPS status from Dynatrace

**URL:** <https://community.dynatrace.com/t/fetch-the-https-status-from-dynatrace/50078>\
**Category:** Dynatrace API\
**Tags:** automations, dynatrace-api\
**Created:** [February 4, 2025, 9:37am UTC](https://community.dynatrace.com/t/fetch-the-https-status-from-dynatrace/50078 "2025-02-04T09:37:21Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![mark\_bley](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mark_bley/32/20954_2.png) [@mark\_bley](https://community.dynatrace.com/u/mark_bley)\
**Post date:** [February 17, 2025, 11:48am UTC](https://community.dynatrace.com/t/fetch-the-https-status-from-dynatrace/50078/2 "2025-02-17T11:48:34Z")

</div>

There are builtin metrics for 4xx or 5xx error codes that you can use in metric events and get alerts on these.

 ![mark_bley_0-1739792110863.png](https://global.discourse-cdn.com/dynatrace/original/3X/1/1/1114eded8bd44d2e742f5fd7c522ecedcfea8032.png)

If you need only the specific error codes I would suggest creating custom metrics that filter on those error codes only.

If you have traces on Grail you can pull the specific status codes on demand

 ![mark_bley_1-1739792888600.png](https://global.discourse-cdn.com/dynatrace/original/3X/8/7/87b96db2d92a248b98340f6bfb914480d4202b14.png)

```markup
fetch spans, from: -30m, to: now(), scanLimitGBytes: 2
| filter in(http.response.status_code, {400, 404, 500, 503})
| summarize count(), by:{service.name, http.request.method ,http.response.status_code}

```

---

_[View the full topic](https://community.dynatrace.com/t/fetch-the-https-status-from-dynatrace/50078)._
