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
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.fixPin 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.fixFor 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.fixEnsure 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.