Sentry 提供了一个名为“nodestore”的抽象,用于存储键/值 blob。
默认后端只是将它们作为 gzipped blob 存储在默认数据库的“nodestore_node”表中。
Django 后端使用 gzipped json blob-as-text 模式将所有数据存储在“nodestore_node”表中。

后端不提供任何选项,因此只需将其设置为空字典即可。

SENTRY_NODESTORE = 'sentry.nodestore.django.DjangoNodeStorage'
SENTRY_NODESTORE_OPTIONS = {}

PostgreSQL 表 nodestore_node, 有3个字段:id, data, "timestamp",其中 data 为base64转码过的zlib压缩过的 json 文本数据。

data 字段样例数据

eJztmv9v2zYWwP8VQ8ABdzhZJSlSJA0ccEWX7Yo1t63NMBwSQ6BEylEsS6q+JDWC/O/3SNmxszm1NtzaA5xfYoXkI9+XDx9p69178cp0TZ623uzeS9adaYO8XJi2Mzowt6bsvJmIJPM3fW1XNbseKSP0AF2NUUtd3ZVukrZWZVzV7hk+Ap3Yp77MQcBb5UWRtyatSu353q0qeuPNMA4YoTBRV3WqCLp8ZY6JEBpI/PAAMtDemU+dW67py61w0ueFBukwgNnF5K8rlZf+5Fw1E0wmBBHqTzCeMTJD5G+Ty+/evIH2gARoDmuUys7hvflx3V1XJTR069o2bKcHLUzT5tC1nd+zyjcqdUubT2nRt/mtiQdlcMAF9r1r1V6DAFXcIJOmUiqOFVEwW1VD+8fe9CboVLsMUlOYZg0dzpW5NUMhE2lQWxoUIWNS29mprgezvWrpbVYfxhqOWSRDIxIjKKdEcR2GJKSK0SiiiO0MGlR2XuyLunHubiGyzdopAuE2pY5rAAJkTHmbN1W5cpH36qbSfdrlzj8Oh2HxJJVKcpyEicpoijMRIooiEaEsoxxTG0KIVqOsowY7pzeVI0Q1C7Dmcu57y7vh+d56FfSINwF5RjUY1a7bAGRuQd57FYA2t6+SvHw1CMCSEDn4e1c1S9N4cxBYNFVvhWPAJ8sXLmzltSpTY+2zXv3+3c+38YfX/7n76fXr5d3371vCCh3+G5lfPhU/3Ly9O785786/OevOL777CeZ2xpfmru3WhZlBpMIpwlOMrXZLsx6cg2FgA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sixYyJ7SebDZATnAM4awA2DhAIe7WymjSWiUMZgKkkbM/HlgIZRBdI1UWmQC8aNgwXeqkWABrOzEwDrlvIi5/Ap5kScRiTARQGWmdXQUXwmpcRy+krAXfE8HX4K+wpcqgVEUIS21SLhKI3wcXzbyUio5O7VL6f/nqU4w/vKnulKMJACDjrQiUh69LgqEyLhTXWBif+M/KbBOOS1K9Ie/7fzx1zgyYYRRbUIaSpEcP9UFhmN9HL5E4JdT/YTwjciXx1fBzZHwLAOGMg5xO4pviMNxP5UKiuTvfVE1P/oO9HHrXF5u3v3Hrpokt0fOqBfVc/9yeEMeV8BxXOQrV0jwrSpaM3QONTi+rcGx/++qVfzn3i+7YQ3MqVz1jNPGOsdN5/bL0wmmQ9XKlHMqdJRFCZ12TdHeuYmGYhJ/KCaxDftFOv5+kc6vlv28fkPXbFt64T9XemHH7oqiNvVSk01J1F5nsLFoW1E1n38GBW6rPo5UnvhPbBk3bCjTsAVqVd+krvwJhrvKrcdqqD337OoruPfwX4AulnI=

以上为base64格式, 转为二进制并存到 a.zip文件:

echo eJztmv9v... |base64 -d >a.zip

python 用 print() 二进制输出 a.zip 的内容

b'x\x9c\xed\x9a\xffo\xdb6\x16\xc0\xff\x15C\xc0\x01w8Y%)R$\r\x1cpE\x97\xed\x8a5\xb7\xad\xcd0\x1c\x12C\xa0D\xcaQ,K\xaa\xbe$5\x82\xfc\xef\xf7H\xd9\xb1\xb39\xb56\xdc\xda\x03\x9c_b\x85\xe4#\xdf\x97\x0f\x1fi\xeb\xdd{\xf1\xcatM\x9e\xb6\xde\xec\xdeK\xd6\x9di\x83\xbc\\\x98\xb63:0\xb7\xa6\xec\xbc\x99\x88$\xf37}mW5\xbb\x1e)#\xf4\x00]\x8dQK]\xdd\x95n\x92\xb6Ve\\\xd5\xee\x19>\x02\x9d\xd8\xa7\xbe\xccA\xc0[\xe5E\x91\xb7&\xadJ\xed\xf9\xde\xad*z\xe3\xcd0\x0e\x18\xa10QWu\xaa\x08\xba|e\x8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xf5R\x93MI\xd4^g\xb0\xb1h[Q5\x9f\x7f\x06\x05n\xab>\x8eT\x9e\xf8Ol\x197l(\xd3\xb0\x05jU\xdf\xa4\xae\xfc\t\x86\xbb\xca\xad\xc7j\xa8=\xf7\xec\xea+\xb8\xf7\xf0_\x80.\x96r'

以上为zlib 压缩格式, 解压代码:

from zlib import *
data = open('/mnt/d/a.zip', 'rb').read()
print(data) # 上面的输出
data = decompress(data)
print(data) # 下面的输出

还原解压后为json格式:

{"_metrics":{"bytes.ingested.event":8695,"bytes.stored.event":9960},"breakdowns":{"span_ops":{"ops.db":{"unit":"millisecond","value":11.524},"total.time":{"unit":"millisecond","value":24.91}}},"contexts":{"runtime":{"build":"3.11.8 (main, Mar 12 2024, 11:52:02) [GCC 12.2.0]","name":"CPython","type":"runtime","version":"3.11.8"},"trace":{"exclusive_time":1.781,"hash":"4a7e0ecc99a71a2a","op":"queue.task.celery","span_id":"a0e6d2029e060eec","status":"ok","trace_id":"e715693e8be84742a7d33234a5466405","type":"trace"}},"culprit":"sentry.tasks.send_ping","environment":"production","event_id":"bc9a971b3baf4c1f830406860ff4714d","extra":{"celery-job":{"args":[],"kwargs":{},"task_name":"sentry.tasks.send_ping"},"sys.argv":["/.venv/bin/sentry","run","worker"]},"grouping_config":{"enhancements":"KLUv_SAYwQAAkwKRs25ld3N0eWxlOjIwMjMtMDEtMTGQ","id":"newstyle:2023-01-11"},"key_id":"1","level":"info","location":"sentry.tasks.send_ping","logger":"","measurements":{"num_of_spans":{"unit":"none","value":12.0}},"metadata":{"location":"sentry.tasks.send_ping","title":"sentry.tasks.send_ping"},"nodestore_insert":1719539280.174933,"platform":"python","project":1,"received":1719539280.130937,"release":"backend@24.5.1+unknown","sdk":{"integrations":["argv","atexit","celery","dedupe","django","django_atomic","excepthook","logging","modules","redis","rust_info","stdlib","threading"],"name":"sentry.python.django","packages":[{"name":"pypi:sentry-sdk","version":"2.2.1"}],"version":"2.2.1"},"span_grouping_config":{"id":"default:2022-10-27"},"spans":[{"data":{"messaging.destination.name":"default","messaging.message.id":"503ae0f3-81af-4e82-bc58-c9fa51ccd592","messaging.message.retry.count":0,"messaging.system":"amqp","thread.id":"140234488200064","thread.name":"MainThread"},"description":"sentry.tasks.send_ping","exclusive_time":3.732,"hash":"4a7e0ecc99a71a2a","op":"queue.process","parent_span_id":"a0e6d2029e060eec","same_process_as_parent":true,"span_id":"adfc1b61f2a1dd8d","start_timestamp":1719539280.067933,"tags":null,"timestamp":1719539280.081319,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"connect","exclusive_time":5.4,"hash":"b640a0ce465fa2a4","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"929b79b1736fb360","start_timestamp":1719539280.068764,"tags":null,"timestamp":1719539280.074164,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.774,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"bf968e3305a4a58c","start_timestamp":1719539280.074283,"tags":null,"timestamp":1719539280.075057,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.281,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"a804213decfc94c9","start_timestamp":1719539280.075652,"tags":null,"timestamp":1719539280.075933,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.226,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"811e202510b948f0","start_timestamp":1719539280.076395,"tags":null,"timestamp":1719539280.076621,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.248,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"bae30798771522b5","start_timestamp":1719539280.076971,"tags":null,"timestamp":1719539280.077219,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"UPDATE \\"sentry_option\\" SET \\"value\\" = %s, \\"last_updated\\" = %s, \\"last_updated_by\\" = %s WHERE \\"sentry_option\\".\\"key\\" = %s","exclusive_time":1.134,"hash":"54b3eaee1482c65e","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"b00f332e9ad8f807","start_timestamp":1719539280.077641,"tags":null,"timestamp":1719539280.078775,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.179,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"b7b626128641fdd6","start_timestamp":1719539280.079076,"tags":null,"timestamp":1719539280.079255,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.201,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"810660d9d8b7ac61","start_timestamp":1719539280.07955,"tags":null,"timestamp":1719539280.079751,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"UPDATE \\"sentry_option\\" SET \\"value\\" = %s, \\"last_updated\\" = %s, \\"last_updated_by\\" = %s WHERE \\"sentry_option\\".\\"key\\" = %s","exclusive_time":1.211,"hash":"54b3eaee1482c65e","op":"db","parent_span_id":"adfc1b61f2a1dd8d","same_process_as_parent":true,"span_id":"aa52b953d6da2995","start_timestamp":1719539280.080021,"tags":null,"timestamp":1719539280.081232,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.908,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"a0e6d2029e060eec","same_process_as_parent":true,"span_id":"9b5254de34398bd6","start_timestamp":1719539280.081907,"tags":null,"timestamp":1719539280.082815,"trace_id":"e715693e8be84742a7d33234a5466405"},{"data":{"db.name":"sentry","db.system":"postgresql","server.address":"sentry-sentry-postgresql","server.port":"5432","thread.id":"140234488200064","thread.name":"MainThread"},"description":"SELECT \\"sentry_option\\".\\"id\\", \\"sentry_option\\".\\"key\\", \\"sentry_option\\".\\"last_updated\\", \\"sentry_option\\".\\"last_updated_by\\", \\"sentry_option\\".\\"value\\" FROM \\"sentry_option\\" WHERE \\"sentry_option\\".\\"key\\" = %s LIMIT 21","exclusive_time":0.962,"hash":"3f644d55e334b4e5","op":"db","parent_span_id":"a0e6d2029e060eec","same_process_as_parent":true,"span_id":"a25527ff4a5f7023","start_timestamp":1719539280.083132,"tags":null,"timestamp":1719539280.084094,"trace_id":"e715693e8be84742a7d33234a5466405"}],"start_timestamp":1719539280.0677,"tags":[["celery_task_id","503ae0f3-81af-4e82-bc58-c9fa51ccd592"],["spans_over_limit","False"],["status","ok"],["task_name","sentry.tasks.send_ping"],["transaction_id",null],["server_name","sentry-worker-7748d6f6b4-trlsw"],["level","info"],["environment","production"],["transaction","sentry.tasks.send_ping"],["sentry:release","backend@24.5.1+unknown"],["runtime","CPython 3.11.8"],["runtime.name","CPython"]],"timestamp":1719539280.084737,"title":"sentry.tasks.send_ping","transaction":"sentry.tasks.send_ping","transaction_info":{"source":"task"},"type":"transaction","version":"7"}

json数据 9551字节
zlib 压缩后 1814字节, 19% 压缩率
base64转码后 2452字节,130% 膨胀率, 最终压缩效果 25%

$ cat a.zip |base64 |wc -c
2452

Yujiaao
12.7k 声望4.7k 粉丝

[链接]