如何使用滚动条设置过去(手动)的时间戳

how to set timestamp in past (manually) with rollbar

我正在使用(无论如何尝试)rollbar 来处理错误日志,这就是我希望手动设置时间戳的原因

根据这里的文档 https://rollbar.com/docs/api/items_post/ 我应该能够使用带有传递的整数(unix 时间戳)的时间戳。 但是数据没有被传递

import json, requests

payload = {
  "access_token": "5m1y2f3a1k2e3t1o2k3e1n238151295b8",
  "data": {
    "environment": "testing",
    "body": {
      "message": {
        "body": "Hello, world!"
      }
    },
    "timestamp": 1460652552  # <--- does not show up on rollbar
  }
}

json_encoded_payload = json.dumps(payload)
requests.post('https://api.rollbar.com/api/1/item/', data=json_encoded_payload)

您描述的行为是设计使然,但我同意这有些令人困惑。这是我们在 https://rollbar.com/docs/timestamps/:

对时间戳的解释的摘录

The original timestamp reported to Rollbar by your application is available in the field metadata.customer_timestamp. It will normally be a unix timestamp as well. You can see this in two places:

  • On the occurrence detail page, the Raw JSON section will include a metadata section. If there was a timestamp in the original report, it will be present as the key customer_timestamp.
  • Via RQL, you can select it as the column name metadata.customer_timestamp