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
{ "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
{ "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?
Answer by JUAN G. · Feb 13, 2018 at 08:28 AM
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:
I raised a Support Case with Dynatrace but am still waiting for their response.
Answer by Gregor L. · Jun 25, 2018 at 10:39 AM
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.
Answer by Wolfgang B. · Jun 25, 2018 at 08:01 AM
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?
Answer by Wolfgang B. · Jun 25, 2018 at 01:11 PM
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.
Learn the enhanced capabilities of the next generation Dynatrace AI root cause analysis and how to feed it with your own data sources.
Wednesday, February 20, 2019
Register today!
Learn the enhanced capabilities of the next generation Dynatrace AI root cause analysis and how to feed it with your own data sources.
Wednesday, February 20, 2019
Register today!
Would you like to have an early taste of what we have cooked up for 2019? We would love to hear your feedback and improve some of the new features. Check NAM 2019 Beta release notes.
Sign up today!
Question about uninstallation of OneAgent Operator for Kubernetes 2 Answers
How much RAM is needed to analyze memory dump? 1 Answer
Is thier any possibilites to create a Custom alert on Log event monitoring 3 Answers
Confirmation of the status of oneagent service 2 Answers
Please can you explain what is Active Wait Wait in DT Managed/SaaS 3 Answers