Search code examples
jsonblobgzipsentry

decompressing gzipped json blob-as-text (nodestore_node table) data from on-premise instance of Sentry


i have an on-premise Sentry instance. we need to export all the event data and be able to read it. i've been able to export the tables that we are interested in and most are readable but there is a nodestore_node table, with data stored as gzipped json blob-as-text, which i'm not familiar with. i've tried a bunch of different things but haven't been successful in converting to something human readable. a few things i've tried so far:

  • SQL uncompress (just ended up with null for each row of converted_data)

    SELECT nodestore_node.data, CONVERT( UNCOMPRESS( nodestore_node.data ) USING 'utf8' ) AS converted_data FROM nodestore_node;

  • SQL cast (got error messages about CAST for this one)

    SELECT CAST( CAST( 'string' as XML ).value('.','varbinary(max)') AS varchar(max) )

  • decompress gzip in JS

i also tried to see if there was an API to export all the data but couldn't find one - if anyone knows a way to pull the converted nodestore data through an on-prem API, i'm all ears.

any ideas would be greatly appreciated!!


Solution

  • there is an events API: https://docs.sentry.io/api/events/list-a-projects-events/

    on-premise auth tokens can be generated as noted in the documentation (https://docs.sentry.io/api/auth/), the base URL just needs to be swapped out:

    {base_url}/settings/account/api/auth-tokens/

    then once a token is generated the events can be called: curl {base_url}/api/0/projects/{organization_slug}/{project_slug}/events/ \ -H 'Authorization: Bearer <auth_token>'

    big thanks to BYK at Sentry for all the answers: https://forum.sentry.io/t/decompressing-gzipped-json-blob-as-text-nodestore-node-table-data-from-on-premise-instance-of-sentry/11897