Post Time Series Data Points - Anodot 1.0 Protocol

DESCRIPTION

This action allows you to create metrics and submit data points for new or existing metrics. You can submit data points for multiple metrics in a single request. 

      1. As a rule of thumb it is recommended not to send more than 1000 samples in a single http request, although it can handle more but the latency will be higher.
      2. Data points should send in chronological order, otherwise data point which is out of order will be dropped.
      3. To assign one or more tags to a metric add the tags to the metric name with a prefix of a hashtag (#).
        Note:
        • The user sends the tags in the string of the metric name every time a sample is sent for that metric. After the user stops send the tag in the metric name the metric will no longer be associated to the tag.
        • It can take up to 20 minutes until the metric tagging operation is applied to the relevant metrics.
        • Tags must not contain the following characters:{ . SPACE}
        • Tags created using this method will not be listed in the GET requests for tag configurations

 DEFINITION

POST https://api.anodot.com/api/v1/metrics?token=<api token>

HEADERS

Content-type=application/json

BODY

[  
   {  
      "name":"<metric name>",
      "timestamp":<epochtime>,
      "value":<value>,
      "tags":{  
         "target_type":"type"
      }
   }
]

 ARGUMENT\ DEFINITION

name

 

 

 

 

  

The unique identifying name of the metric being tracked.

Metric name legal character set: 
1. Any ascii printable character from the range 32-126 except for ' (single quote} and space. 
2. The following characters will require using escape characters when searching for metrics in Anodot:
+ - ! ^ && [ ] { } < > ~ || " ? = 

Special characters: 
. - Separator between key/values pairs 
# - metric tag – add a tag to a metric, doesn’t impact metric uniqueness
= - key value separator 

For more details about metric naming conventions, see Metric Naming Conventions.

timestamp

Epoch (unix) time of the metric sample in seconds.

 value

Double-precision 64-bit IEEE 754 floating point

 tags

Optional key-value property pair
  Key               value
  target_type   counter - Aggregations using sum
  target_type    gauge - Aggregation using
                                      average (default)

EXAMPLE REQUEST

curl \
-X POST \
-d "[{"name":"company=anodot.device=test.what=hello_world_count",
"timestamp":`date +%s`,"value":100,"tags":{"target_type":"counter"}}]" \
-H "Content-Type: application/json" \
'https://api.anodot.com/api/v1/metrics?token=<API TOKEN>'

Note:  Expect the sample array to be sorted by the sample timestamp; samples are processed in the order they appear in the given JSON array - out-of-order samples (in the context of the same metric) will be discarded.

EXAMPLE RESPONSE 

{  
   "errors":[]
}

For more details about example responses, see Success and Errors

Was this article helpful?
0 out of 0 found this helpful