Skip to content

Commit 23e6bd7

Browse files
Merge pull request #19193 from newrelic/NR-258482-timestamp-attribute-value-update
chore(metric API): timestamp value update
2 parents b6fbb1c + 5aa777a commit 23e6bd7

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

src/content/docs/data-apis/ingest-apis/metric-api/report-metrics-metric-api.mdx

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,13 @@ Use the [Metric API](/docs/introduction-new-relic-metric-api) to send custom met
2222

2323
We report the metric types `count`, `gauge`, and `summary`. For more information on metrics see [our documentation](/docs/telemetry-data-platform/ingest-manage-data/understand-data/metric-data-type).
2424

25-
Metric data is submitted to New Relic through an HTTP POST request. Each request is composed of one or more metric data points, which consist of a metric name, a timestamp, and a value.
25+
Submit metric data to New Relic through an HTTP POST request. Compose each request with one or more metric data points, that consist of a `name`, a `timestamp`, and a `value` for the metric.
2626

2727
Follow this example to send your first metric data points to New Relic:
2828

2929
1. Get the <InlinePopover type="licenseKey"/> for the account you want to report data to.
3030
2. Insert the license key into the following JSON, and then send the JSON to our [endpoint](#api-endpoint).
31-
3. Update the `timestamp` with a valid epoch timestamp.
31+
3. For `timestamp` replace `INSERT_CURRENT_TIMESTAMP` with a valid [epoch timestamp](#json-payload-keys).
3232
This example creates a single metric data point for a metric named `memory.heap`, but you can create additional attributes or data points by specifying [metric types](/docs/telemetry-data-platform/ingest-manage-data/understand-data/metric-data-type) or adding [optional `common` blocks](#optional-map-attributes).
3333

3434
```bash
@@ -40,7 +40,7 @@ Follow this example to send your first metric data points to New Relic:
4040
"name":"memory.heap",
4141
"type":"gauge",
4242
"value":2.3,
43-
"timestamp":CURRENT_TIME,
43+
"timestamp":INSERT_CURRENT_TIMESTAMP,
4444
"attributes":{"host.name":"dev.server.com"}
4545
}]
4646
}]'
@@ -194,7 +194,7 @@ The JSON payload uses this structure:
194194
"name": "service.errors.all",
195195
"type": "count",
196196
"value": 15,
197-
"timestamp": CURRENT_TIME,
197+
"timestamp":INSERT_CURRENT_TIMESTAMP,
198198
"interval.ms": 10000,
199199
"attributes": {
200200
"service.response.statuscode": "400",
@@ -206,7 +206,7 @@ The JSON payload uses this structure:
206206
"name": "service.memory",
207207
"type": "gauge",
208208
"value": 2.7,
209-
"timestamp": CURRENT_TIME,
209+
"timestamp":INSERT_CURRENT_TIMESTAMP,
210210
"attributes": {
211211
"host.name": "dev.server.com",
212212
"app.name": "foo"
@@ -269,7 +269,7 @@ Each metric data point map in the `metrics` array uses the following key-value s
269269
</td>
270270

271271
<td>
272-
<DNT>**Required**</DNT>. The metric's start time in [Unix time](https://currentmillis.com/). The default uses UTC time zone. This field also support seconds, microseconds, and nanoseconds. However, the data will be converted to milliseconds for storage and query. Metrics reported with a timestamp older than 48 hours ago or newer than 24 hours from the time they are reported are dropped.
272+
<DNT>**Required**</DNT>. The metric's start time in [Unix time](https://currentmillis.com/). The default uses UTC time zone. This field also support seconds, microseconds, and nanoseconds. However, the data will be converted to milliseconds for storage and query. Metrics are dropped if they have a timestamp more than 48 hours in the past or more than 24 hours in the future from the time they are reported.
273273
</td>
274274
</tr>
275275

@@ -324,7 +324,7 @@ Each metric data point map in the `metrics` array uses the following key-value s
324324
"name": "cache.misses",
325325
"type": "count",
326326
"value": 15,
327-
"timestamp": CURRENT_TIME,
327+
"timestamp":INSERT_CURRENT_TIMESTAMP,
328328
"interval.ms": 10000,
329329
"attributes": {
330330
"cache.name": "myCache",
@@ -335,7 +335,7 @@ Each metric data point map in the `metrics` array uses the following key-value s
335335
"name": "temperature",
336336
"type": "gauge",
337337
"value": 15,
338-
"timestamp": CURRENT_TIME,
338+
"timestamp":INSERT_CURRENT_TIMESTAMP,
339339
"attributes": {
340340
"city": "Portland",
341341
"state": "Oregon"
@@ -351,7 +351,7 @@ Each metric data point map in the `metrics` array uses the following key-value s
351351
"max": 0.001708826
352352
},
353353
"interval.ms": 10000,
354-
"timestamp": CURRENT_TIME,
354+
"timestamp":INSERT_CURRENT_TIMESTAMP,
355355
"attributes": {
356356
"host.name": "dev.server.com",
357357
"app.name": "foo"

0 commit comments

Comments
 (0)