# Can't see custom metrics created via API in the list of the menu "Create custom chart"

**URL:** <https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091>\
**Category:** Dynatrace API\
**Tags:** dynatrace-managed, data-explorer, dynatrace-api\
**Created:** [November 13, 2017, 4:28pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091 "2017-11-13T16:28:32Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![quentin\_badoud](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@quentin\_badoud](https://community.dynatrace.com/u/quentin_badoud)\
**Post date:** [November 13, 2017, 4:28pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/1 "2017-11-13T16:28:32Z")

</div>

I am trying to create a custom metric and add some custom device.

First I created a custom metrics with API:

HTTP PUT

api/v1/timeseries/ **custom:nas.connections.dropped**?Api-Token=my\_token

```auto
{
	"displayName" : "Nas connection dropped",
	"unit" : "Count",
	"dimensions": [
		"nic"
	],
	"types": [
		"NAS"
	]
}

```

Then I added a custom device with some data

HTTP POST

api/v1/entity/infrastructure/custom/ **SMNAS01**?Api-Token=my\_token

```auto
{
  "displayName" : "SMNAS01",
  "ipAddresses" : ["172.20.11.43"],
  "listenPorts" : ["9999"],
  "type" : "NAS",
  "favicon" : "https://maxcdn.icons8.com/Share/icon/Network//nas_filled1600.png",
  "configUrl" : "http://172.20.11.43:80",
  "tags": ["myTagNas", "myTagNas2"],
  "properties" : { "prop1" : "propvalue" },
  "series" : [
    {
      "timeseriesId" : "custom:nas.connections.dropped",
      "dimensions" : { "nic" : "ethernetcard1" },
      "dataPoints" : [[1510309648, 10]]
    }
  ]
}

```

So my custom device **SMNAS01** is created, and i can find it on dynatrace web console. However i dont see any data relative to the metrics. And if i go to the menu “Create Custom Chart” I cannot see my custom metrics.. (but i can retrieve it with API)

Any Idea?

---

<div class="post-metadata">

**Author:** ![quentin\_badoud](https://avatars.discourse-cdn.com/v4/letter/q/91b2a8/32.png) [@quentin\_badoud](https://community.dynatrace.com/u/quentin_badoud)\
**Post date:** [November 17, 2017, 10:27am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/2 "2017-11-17T10:27:12Z")

</div>

Nobody knows?

---

<div class="post-metadata">

**Author:** ![juanjose\_garci1](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/juanjose_garci1/32/18873_2.png) [@juanjose\_garci1](https://community.dynatrace.com/u/juanjose_garci1)\
**Post date:** [February 13, 2018, 8:28am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/3 "2018-02-13T08:28:50Z")

</div>

Hi Quentin.

I´m having the same issue. When I call the Dynatrace API to insert the data I get a http Code ‘202’ instead of a http Code ‘200’, I guess that´s why the data is never inserted into Dynatrace:

 ![15812-img-001.jpg](https://global.discourse-cdn.com/dynatrace/original/3X/8/8/88bef2b16d1cdc7ed5930fec0ba4f8edde3945be.jpeg)

I raised a Support Case with Dynatrace but am still waiting for their response.

---

<div class="post-metadata">

**Author:** ![d\_derthe](https://avatars.discourse-cdn.com/v4/letter/d/7c8e57/32.png) [@d\_derthe](https://community.dynatrace.com/u/d_derthe)\
**Post date:** [February 22, 2018, 11:14pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/4 "2018-02-22T23:14:45Z")

</div>

Hi,

I’ve the same issue too…

---

<div class="post-metadata">

**Author:** ![gregor\_liddell](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gregor_liddell/32/29343_2.png) [@gregor\_liddell](https://community.dynatrace.com/u/gregor_liddell)\
**Post date:** [April 19, 2018, 11:51am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/5 "2018-04-19T11:51:06Z")

</div>

I have the same issue, glad I’m not alone !!

---

<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:** [June 25, 2018, 8:01am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/6 "2018-06-25T08:01:22Z")

</div>

Hard to tell what could be the reason you don’t get the metric into the custom chart selector. By design it should appear there of course.

Common pitfalls that we identified are:

- Always send the ‘type’ property with each update of your metric data.

- Check your metric name, its case sensitive.

- Use current timestamp that does not lie in the future and not older than an hour, otherwise your metric data will be rejected.

- Always send the correct dimensions, if you defined ones.

From the example code above it seems that the ‘type’, dimensions and also metric names are correct. Did you check the timestamp and did you send continuously data?

Do you find your device in Smartscape and does the custom device show some charts?

---

<div class="post-metadata">

**Author:** ![gregor\_liddell](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/gregor_liddell/32/29343_2.png) [@gregor\_liddell](https://community.dynatrace.com/u/gregor_liddell)\
**Post date:** [June 25, 2018, 10:39am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/7 "2018-06-25T10:39:17Z")

</div>

Hi, on this side it turned out to be the timestamps we were sending because managed is compensating for timezones. We’re on GMT +2 which managed knows about. I was sending timestamps using utcnow() (ie. GMT) but managed is compensating and subtracting the two hours off (because we’re on GMT +2) so my metrics were technically four hours behind and enever got displayed. As soon as I started using now() instead of utcnow() to calculate the timestamps, voila !! I started getting metrics.

---

<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:** [June 25, 2018, 1:11pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/8 "2018-06-25T13:11:39Z")

</div>

We will improve the usability of this API soon in order to return rejection reasons synchronously. So in an upcoming release we will return a error message in case we rejected the timestamp because its too old or in the future.

---

<div class="post-metadata">

**Author:** ![FShimaya](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@FShimaya](https://community.dynatrace.com/u/FShimaya)\
**Post date:** [May 16, 2019, 9:17pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/9 "2019-05-16T21:17:16Z")

</div>

I am experiencing the same issue. What’s strange for me is that I can find it if I type in the custom device name in the search field of the Dynatrace web-console. It shows it in the results and you can click on the link to get to it

---

<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:** [May 17, 2019, 6:25am UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/10 "2019-05-17T06:25:14Z")

</div>

Please check the list of your custom devices that is accessible in technology screen as shown below:

 ![20574-dy.png](https://global.discourse-cdn.com/dynatrace/original/2X/6/66d399554fa986f803cac3a47825473634975389.png)

Search for your custom device and check if your metric appears there.

Did you check my hints above? Timestamp correct?

---

<div class="post-metadata">

**Author:** ![FShimaya](https://avatars.discourse-cdn.com/v4/letter/f/c6cbf5/32.png) [@FShimaya](https://community.dynatrace.com/u/FShimaya)\
**Post date:** [May 17, 2019, 5:03pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/11 "2019-05-17T17:03:19Z")

</div>

Ok this issue for me is now resolved. I opened a support ticket with Dynatrace and a solution was quickly provided: Update my ruleset filter so that it includes custom devices.  
 ![20583-filter.png](https://global.discourse-cdn.com/dynatrace/original/3X/c/e/ce1913ae85dfa5f9df74434a16afef4acc5cc6f5.png)  
To do that, you would go to Settings \> Preferences \> Management zones

---

<div class="post-metadata">

**Author:** ![mcattarin](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/mcattarin/32/32169_2.png) [@mcattarin](https://community.dynatrace.com/u/mcattarin)\
**Post date:** [September 24, 2022, 10:28pm UTC](https://community.dynatrace.com/t/cant-see-custom-metrics-created-via-api-in-the-list-of-the-menu-create-custom-chart/9091/12 "2022-09-24T22:28:53Z")

</div>

Hi Wolfgang,

do you know if this improvement has been implemented yet?

I’m asking you this because I’ve just faced a problem similar to that one Gregor described and the response I was getting from the server was the following (HTTP status code 202):

```javascript
{"linesOk":3,"linesInvalid":0,"error":null,"warnings":null}

```

Everything seemed OK but I could not see those metrics in Dynatrace (SAAS). I later discovered that I was sending, in the payload, timestamps in seconds instead of milliseconds:

```markup
metric.key,dimension=value gauge,5.9361 1664057158

```

Once the missing zeros were&nbsp;added, metrics started appearing in the Data Explorer as expected.  
&nbsp;It would be nice to be immediately notified of these kinds of errors, avoiding spending time in&nbsp;pernicious troubleshooting.
