【问题标题】:how to set timestamp in past (manually) with rollbar如何使用滚动条(手动)设置过去的时间戳
【发布时间】:2016-10-31 18:46:36
【问题描述】:

我正在使用(无论如何尝试)滚动条来处理错误日志,这就是为什么我希望手动设置时间戳

根据此处的文档 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)

【问题讨论】:

  • 我刚刚注意到时间确实被发送了。我看到Received On : 2016-10-31 11:42:56 am PDTNotifier Timestamp : 2016-04-14 09:49:12 am PDT我想这意味着我可能无法使用它,因为时间信息不会取代报告的时间戳

标签: python rollbar


【解决方案1】:

您描述的行为是设计使然,尽管我同意这有点令人困惑。以下是我们在https://rollbar.com/docs/timestamps/ 对时间戳的解释摘录:

您的应用程序向 Rollbar 报告的原始时间戳是 在metadata.customer_timestamp 字段中可用。通常会 也是一个unix时间戳。您可以在两个地方看到这一点:

  • 在发生详细信息页面上,原始 JSON 部分将包含一个 元数据部分。如果原始报告中有时间戳,则 将作为关键的 customer_timestamp 出现。
  • 通过RQL,你可以选择它作为列名metadata.customer_timestamp

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-06-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-02-19
    • 2019-01-14
    相关资源
    最近更新 更多