{"library":"sentry-protos","title":"Sentry Protobuf Definitions (Generated Python Code)","description":"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install sentry-protos"],"cli":null},"imports":["from sentry_protos.snuba.v1 import snuba_pb2","from sentry_protos.some_service.vX import some_service_pb2"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from sentry_protos.snuba.v1 import snuba_pb2\n\n# Create a QueryRequest message\nquery_request = snuba_pb2.QueryRequest(\n    dataset='events',\n    query=\"MATCH (event) SELECT event.id\"\n)\n\nprint(f\"Successfully created Snuba QueryRequest:\")\nprint(f\"  Dataset: {query_request.dataset}\")\nprint(f\"  Query: {query_request.query}\")\n\n# You can also set fields dynamically\nanother_query = snuba_pb2.QueryRequest()\nanother_query.dataset = 'transactions'\nanother_query.query = 'MATCH (transaction) SELECT transaction.duration'\n\nprint(f\"\\nAnother QueryRequest: {another_query.query}\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}