Trace Metric API request using request ID

I’m having issues finding out exactly why my Metric API requests don’t seem to go through.

Here’s my curl command:

curl -vvv -k -H "Content-Type: application/json" \
-H "Api-Key: NEW_RELIC_LICENSE_KEY" \
-X POST https://metric-api.eu.newrelic.com/metric/v1 \
--data '[{"metrics":[{"name":"test1.test2.test3","type":"gauge","value":0,"timestamp":1654177041}]}]'

Which returns 202 with a valid requestId, but the metric data won’t show up in the explorer. I’m wondering if I could use the returned id to find out what exactly went wrong with the request. The payload seems to be fine, as in all the required fields are there and are valid. I have no recent NrIntegrationErrors either.

The same request seems to work just fine when using the SDK - newrelic.recordMetric("test1.test2.test3", 0)

Hi @norbert.dombi - That’s interesting that there are no NRIntegrationError errors. A 202 will be returned if the connection is successful and the payload is delivered. If the data doesn’t show up with a 202 response it almost always is an issue with the payload. If the payload is invalid we drop the payload and there isn’t a record or payload to analyze at that point.

You might want to make sure your timestamp is valid. Metrics reported with a timestamp older than 48 hours ago or newer than 24 hours from the time they are reported are dropped.