Skip to content

Grafana Data Source integration error: json: cannot unmarshal number into Go struct field SentryProject.id of type string

Review this checklist before submitting.

  • GitLab issues are for bug reports and feature requests. If this is a help request, post on Gitter. If you have or want paid support, please use the chat widget on https://glitchtip.com.
  • Document reproduction steps. Be as detailed as possible.
  • If applicable, try to reproduce the problem on https://app.glitchtip.com
  • Be considerate of the reviewer of your issue and their time. They are likely unpaid. GlitchTip is open source and comes with absolutely no warranty.
  • Check existing issues first. 👍 the issue to show interest.
  • Do not open issue related to automated security scanners or other static anaysis tool. We use Renovate and GitLab for this. Instead, ask on Gitter how you can help get involved in the project and make the changes you wish to see.

Description

  • Tried to add glitch-tip as Sentry Data Source in Grafana.
  • Received the following error in grafana: json: cannot unmarshal number into Go struct field SentryProject.id of type string
  • Reproduced on my local instance and on https://app.glitchtip.com
  • Reproduced on my local and the official hosted Grafana

Proposed Solution(s)

I compared the responses from official sentry and glitchtip for the called endpoint

GET /api/0/organizations/<orgname>/projects/

It appears that Sentry returns all id fields as string, whereas glitchtip returns them as a number.

Sentry Response

[
  {
    "team": {
      "id": "1111111",
      "slug": "<org>",
      "name": "<org name>"
    },
    "teams": [
      {
        "id": "11111112",
        "slug": "<org>",
        "name": "<org name>"
      }
    ],
    "id": "111113",
    "name": "android",
    "slug": "android",
    "isBookmarked": false,
    "isMember": true,
    "access": [
    ....

Glitchtip Response

[
  {
    "name": "fff-android",
    "slug": "fff-android",
    "avatar": {
      "avatarType": "",
      "avatarUuid": null
    },
    "color": "",
    "features": [],
    "hasAccess": true,
    "isBookmarked": false,
    "isInternal": false,
    "isMember": true,
    "isPublic": false,
    "scrubIPAddresses": true,
    "dateCreated": "2024-08-22T05:40:21.011Z",
    "platform": "java-android",
    "firstEvent": null,
    "id": 11111,
    "eventThrottleRate": 0,
    "teams": [
      {
        "id": 5797,
        "slug": "ffff"
      }
    ]
  }
]```
Edited by Peter Spiess-Knafl