Registry / serialization / sentry-protos

sentry-protos

JSON →
library0.31.2pypypiunverified

sentry-protos provides the auto-generated Python code for Sentry's internal Protobuf definitions. It encapsulates the data structures used across various Sentry services, allowing Python applications to interact with Sentry's protobuf-based APIs. The library is actively maintained with frequent minor releases to incorporate new or updated protobuf schemas.

pip install sentry-protos
INSTALL
IMPORT
SIG · SENTRY-PROTOS
S
sentry-protos
serializationpythonv0.31.2
Install
2.9s avg
Import
Disk
40MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.14.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 3.55s
py 3.11
✓ —
✓ 3s
py 3.12
✓ —
✓ 2.55s
py 3.13
✓ —
✓ 2.65s
py 3.9
✕ build_error
✕ build_error
40MB installed
● package 40MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

snuba_pb2
from sentry_protos.snuba.v1 import snuba_pb2
from sentry_protos.snuba.v1 import snuba_pb2

This quickstart demonstrates how to import a specific generated protobuf message (Snuba QueryRequest) and instantiate it, setting its fields. Remember to replace `snuba.v1` and `snuba_pb2` with the actual service and version you intend to use.

from sentry_protos.snuba.v1 import snuba_pb2 # Create a QueryRequest message query_request = snuba_pb2.QueryRequest( dataset='events', query="MATCH (event) SELECT event.id" ) print(f"Successfully created Snuba QueryRequest:") print(f" Dataset: {query_request.dataset}") print(f" Query: {query_request.query}") # You can also set fields dynamically another_query = snuba_pb2.QueryRequest() another_query.dataset = 'transactions' another_query.query = 'MATCH (transaction) SELECT transaction.duration' print(f"\nAnother QueryRequest: {another_query.query}")
Debug
Known issues
breakingAs `sentry-protos` is a pre-1.0 library (version 0.x.y), minor version bumps (e.g., 0.8.x to 0.9.x) can introduce breaking changes to message definitions or removal of fields/services. Always review the changelog when upgrading.
fix
Pin your `sentry-protos` dependency to a specific minor version (e.g., `sentry-protos~=0.8.0`) and carefully test upgrades.
affects: 0.x.y (all versions)
gotchaThis package contains only the generated Python message definitions (`_pb2.py` files). It does not include gRPC service stubs or client/server code (`_pb2_grpc.py` files). If you need to implement gRPC services or clients based on these protos, you will need `grpcio` and `grpcio-tools` and will have to generate those stubs yourself.
fix
For gRPC client/server code, use `grpcio` and `grpcio-tools` with the original `.proto` files to generate service stubs. `sentry-protos` is strictly for data serialization/deserialization.
affects: All versions
gotchaDue to Sentry's continuous development, upstream `.proto` definitions are frequently updated. This means `sentry-protos` receives regular updates to reflect new fields, messages, or services. Older versions of `sentry-protos` may lack definitions for newer features or services, leading to `AttributeError` or unexpected behavior.
fix
Ensure your `sentry-protos` package is kept up-to-date (`pip install --upgrade sentry-protos`) to access the latest protobuf definitions. If you encounter missing fields or messages, an upgrade is often the first step.
affects: All versions
Upgrade
Version history
0.31.2latest on PyPI · released Jun 16, 2026
Audit
Dependencies
protobufrequiredRequired runtime dependency for all generated protobuf code.
Agent activity
16 hits · last 30 days
node
14
OpenAI (training)
2
Resources
sentry-protos — pip install sentry-protos · libregistry