diff --git a/requirements.txt b/requirements.txt index 561f2d2719..f53a2fea10 100644 --- a/requirements.txt +++ b/requirements.txt @@ -28,7 +28,7 @@ python-dateutil==2.8.2 python-rapidjson==1.8 redis==4.5.4 sentry-arroyo==2.19.12 -sentry-kafka-schemas==1.0.4 +sentry-kafka-schemas==1.0.8 sentry-protos==0.1.59 sentry-redis-tools==0.3.0 sentry-relay==0.9.5 diff --git a/rust_snuba/Cargo.lock b/rust_snuba/Cargo.lock index 5e5571133c..9cecd670dc 100644 --- a/rust_snuba/Cargo.lock +++ b/rust_snuba/Cargo.lock @@ -3503,9 +3503,9 @@ dependencies = [ [[package]] name = "sentry-kafka-schemas" -version = "1.0.4" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c53d99e2723913e49725e448686449519fb82a9d31db87d1e8bf4481eab4d8c" +checksum = "32c35142d3b498911603ed5f98ff735ea2e6dea04c0745e77dd9c401aa033849" dependencies = [ "jsonschema", "prettyplease", @@ -3583,9 +3583,9 @@ dependencies = [ [[package]] name = "sentry_protos" -version = "0.1.59" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a7e373d284d5cddfeaa22c983f496ae5569d9902c2f8620492887313960de3" +checksum = "a060b0d2fd902009cdd82177ad6696d43904be19ed328a1bfa04995a36702e59" dependencies = [ "glob", "prost", diff --git a/rust_snuba/Cargo.toml b/rust_snuba/Cargo.toml index 3cf040fcb0..83f094876a 100644 --- a/rust_snuba/Cargo.toml +++ b/rust_snuba/Cargo.toml @@ -32,7 +32,7 @@ procspawn = { version = "1.0.0", features = ["json"] } pyo3 = { version = "0.18.1", features = ["chrono"] } reqwest = { version = "0.11.11", features = ["stream"] } sentry = { version = "0.32.0", features = ["anyhow", "tracing"] } -sentry-kafka-schemas = "1.0.4" +sentry-kafka-schemas = "1.0.8" serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0" } thiserror = "1.0" diff --git a/rust_snuba/src/processors/uptime_monitor_checks.rs b/rust_snuba/src/processors/uptime_monitor_checks.rs index 9069c7f7c5..d49d3f5b8e 100644 --- a/rust_snuba/src/processors/uptime_monitor_checks.rs +++ b/rust_snuba/src/processors/uptime_monitor_checks.rs @@ -42,6 +42,7 @@ pub fn deserialize_message(payload: &[u8]) -> anyhow::Result<(Vec { status_reason: Option>, trace_id: Uuid, request_info: Option, + incident_status: u16, } #[derive(Debug, Deserialize, Default)] pub struct RequestInfo { @@ -95,6 +97,7 @@ pub struct UptimeMonitorCheckRow<'a> { http_status_code: Option, trace_id: Uuid, retention_days: u16, + incident_status: u16, } #[cfg(test)] @@ -121,6 +124,7 @@ mod tests { }, "http_status_code": 200, "trace_id": "550e8400-e29b-41d4-a716-446655440000", + "incident_status": 0, "request_info": { "request_type": "GET", "http_status_code": 200 @@ -145,6 +149,7 @@ mod tests { assert_eq!(monitor_row.retention_days, 30); assert_eq!(monitor_row.scheduled_check_time, 1702659277); assert_eq!(monitor_row.timestamp, 1702659277000); + assert_eq!(monitor_row.incident_status, 0); assert_eq!(timestamp, 1702659277000.0); } @@ -165,6 +170,7 @@ mod tests { "status_reason": null, "http_status_code": 200, "trace_id": "550e8400-e29b-41d4-a716-446655440000", + "incident_status": 0, "request_info": { "request_type": "GET", "http_status_code": 200 @@ -188,6 +194,7 @@ mod tests { assert_eq!(monitor_row.check_status_reason, ""); assert_eq!(monitor_row.http_status_code, Some(200)); assert_eq!(monitor_row.retention_days, 30); + assert_eq!(monitor_row.incident_status, 0); assert_eq!(timestamp, 1702659277.0); } } diff --git a/snuba/datasets/configuration/events_analytics_platform/entities/uptime_checks.yaml b/snuba/datasets/configuration/events_analytics_platform/entities/uptime_checks.yaml index b54139b5db..c4aae6b81a 100644 --- a/snuba/datasets/configuration/events_analytics_platform/entities/uptime_checks.yaml +++ b/snuba/datasets/configuration/events_analytics_platform/entities/uptime_checks.yaml @@ -18,6 +18,7 @@ schema: { name: http_status_code, type: UInt, args: { size: 16, schema_modifiers: [nullable] } }, { name: trace_id, type: UUID }, { name: retention_days, type: UInt, args: { size: 16 } }, + { name: incident_status, type: UInt, args: { size: 16 } }, ] storages: diff --git a/snuba/datasets/configuration/events_analytics_platform/storages/uptime_monitor_checks.yaml b/snuba/datasets/configuration/events_analytics_platform/storages/uptime_monitor_checks.yaml index aed55bf6e6..796099843f 100644 --- a/snuba/datasets/configuration/events_analytics_platform/storages/uptime_monitor_checks.yaml +++ b/snuba/datasets/configuration/events_analytics_platform/storages/uptime_monitor_checks.yaml @@ -22,6 +22,7 @@ schema: { name: http_status_code, type: UInt, args: { size: 16, schema_modifiers: [nullable] } }, { name: trace_id, type: UUID }, { name: retention_days, type: UInt, args: { size: 16 } }, + { name: incident_status, type: UInt, args: { size: 16 } }, ] local_table_name: uptime_monitor_checks_v2_local dist_table_name: uptime_monitor_checks_v2_dist diff --git a/snuba/web/rpc/v1/resolvers/R_uptime_checks/common/common.py b/snuba/web/rpc/v1/resolvers/R_uptime_checks/common/common.py index 90677c1cfa..a9db59fff9 100644 --- a/snuba/web/rpc/v1/resolvers/R_uptime_checks/common/common.py +++ b/snuba/web/rpc/v1/resolvers/R_uptime_checks/common/common.py @@ -77,6 +77,7 @@ def transform(exp: Expression) -> Expression: "check_status_reason": AttributeKey.Type.TYPE_STRING, "http_status_code": AttributeKey.Type.TYPE_INT, "trace_id": AttributeKey.Type.TYPE_STRING, + "incident_status": AttributeKey.Type.TYPE_INT, "retention_days": AttributeKey.Type.TYPE_INT, } diff --git a/tests/web/rpc/v1/test_endpoint_time_series/test_endpoint_time_series_uptime_checks.py b/tests/web/rpc/v1/test_endpoint_time_series/test_endpoint_time_series_uptime_checks.py index d318c22fcb..996a953d7e 100644 --- a/tests/web/rpc/v1/test_endpoint_time_series/test_endpoint_time_series_uptime_checks.py +++ b/tests/web/rpc/v1/test_endpoint_time_series/test_endpoint_time_series_uptime_checks.py @@ -47,6 +47,7 @@ def gen_message( }, "http_status_code": 200, "trace_id": _TRACE_ID, + "incident_status": 0, "request_info": { "request_type": "GET", "http_status_code": 200, @@ -73,7 +74,8 @@ def store_timeseries( dt = start_datetime + timedelta(seconds=secs) messages.append(gen_message(dt)) uptime_checks_storage = get_storage(StorageKey("uptime_monitor_checks")) - write_raw_unprocessed_events(uptime_checks_storage, messages) # type: ignore + write_raw_unprocessed_events( + uptime_checks_storage, messages) # type: ignore @pytest.mark.clickhouse_db @@ -193,6 +195,7 @@ def test_with_group_by(self) -> None: ], group_by=[ AttributeKey(type=AttributeKey.TYPE_STRING, name="region"), + AttributeKey(type=AttributeKey.TYPE_STRING, name="incident_status"), ], granularity_secs=granularity_secs, ) @@ -206,7 +209,7 @@ def test_with_group_by(self) -> None: TimeSeries( label="count", buckets=expected_buckets, - group_by_attributes={"region": "global"}, + group_by_attributes={"region": "global", "incident_status": 0}, data_points=[ DataPoint(data=300, data_present=True) for _ in range(len(expected_buckets)) diff --git a/tests/web/rpc/v1/test_endpoint_trace_item_table/test_endpoint_trace_item_table_uptime_checks.py b/tests/web/rpc/v1/test_endpoint_trace_item_table/test_endpoint_trace_item_table_uptime_checks.py index 1954cccd1b..cb50d421f0 100644 --- a/tests/web/rpc/v1/test_endpoint_trace_item_table/test_endpoint_trace_item_table_uptime_checks.py +++ b/tests/web/rpc/v1/test_endpoint_trace_item_table/test_endpoint_trace_item_table_uptime_checks.py @@ -52,6 +52,7 @@ def gen_message( }, "http_status_code": 200, "trace_id": _TRACE_ID, + "incident_status": False, "request_info": { "request_type": "GET", "http_status_code": 200,