Skip to content

Commit

Permalink
Merge branch 'master' into feat/tx-span-data
Browse files Browse the repository at this point in the history
* master:
  feat(getter): Add logentry getter to event (#3796)
  feat(rule-condition): Add `any` and `all` loop conditions (#3791)
  ref(normalization): Remove normalization debug metrics (#3786)
  fix(redis): Fix Redis data corruption on connection timeout (#3792)
  fix(spans): Fixes span outcomes and inherited rate limits (#3793)
  build(py): Update craft to use new manylinux wheels (#3789)
  • Loading branch information
jan-auer committed Jul 8, 2024
2 parents ed392a8 + 9d24cb3 commit 606c6b0
Show file tree
Hide file tree
Showing 14 changed files with 560 additions and 195 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

- Fixes raw OS description parsing for iOS and iPadOS originating from the Unity SDK. ([#3780](https://github.com/getsentry/relay/pull/3780))
- Fixes metrics dropped due to missing project state. ([#3553](https://github.com/getsentry/relay/issues/3553))
- Incorrect span outcomes when generated from a indexed transaction quota. ([#3793](https://github.com/getsentry/relay/pull/3793))
- Report outcomes for spans when transactions are rate limited. ([#3749](https://github.com/getsentry/relay/pull/3749))

**Internal**:
Expand All @@ -17,6 +18,7 @@
- Support extrapolation of metrics extracted from sampled data, as long as the sample rate is set in the DynamicSamplingContext. ([#3753](https://github.com/getsentry/relay/pull/3753))
- Extract thread ID and name in spans. ([#3771](https://github.com/getsentry/relay/pull/3771))
- Compute metrics summary on the extracted custom metrics. ([#3769](https://github.com/getsentry/relay/pull/3769))
- Add support for `all` and `any` `RuleCondition`(s). ([#3791](https://github.com/getsentry/relay/pull/3791))

## 24.6.0

Expand Down
30 changes: 14 additions & 16 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ rand = "0.8.5"
rand_pcg = "0.3.1"
rdkafka = "0.29.0"
rdkafka-sys = "4.3.0"
# Git revision until https://github.com/redis-rs/redis-rs/pull/1097 is released (already merged).
redis = { git = "https://github.com/redis-rs/redis-rs.git", rev = "7e79e3a380a07eb0c1e559d9afa9152a87d2e50c", default-features = false }
# Git revision until https://github.com/redis-rs/redis-rs/pull/1097 (merged) and https://github.com/redis-rs/redis-rs/pull/1253 are released.
redis = { git = "https://github.com/redis-rs/redis-rs.git", rev = "939e5df6f9cc976b0a53987f6eb3f76b2c398bd6", default-features = false }
regex = "1.10.2"
reqwest = "0.11.1"
rmp-serde = "1.1.1"
Expand Down Expand Up @@ -175,7 +175,7 @@ tracing-subscriber = "0.3.17"
uaparser = "0.6.0"
unescaper = "0.1.4"
unicase = "2.6.0"
url = "2.1.1"
url = "2.5.2"
utf16string = "0.2.0"
uuid = { version = "1.7.0", features = ["serde", "v4"] }
walkdir = "2.3.2"
Expand Down
4 changes: 2 additions & 2 deletions py/.craft.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ targets:
requireNames:
- /^sentry_relay-.*-py2\.py3-none-macosx_13_0_x86_64.whl$/
- /^sentry_relay-.*-py2\.py3-none-macosx_14_0_arm64.whl$/
- /^sentry_relay-.*-py2\.py3-none-.*manylinux2014_x86_64.*\.whl$/
- /^sentry_relay-.*-py2\.py3-none-.*manylinux2014_aarch64.*\.whl$/
- /^sentry_relay-.*-py2\.py3-none-.*manylinux_2_28_x86_64.*\.whl$/
- /^sentry_relay-.*-py2\.py3-none-.*manylinux_2_28_aarch64.*\.whl$/
- /^sentry-relay-.*\.zip$/
37 changes: 36 additions & 1 deletion relay-event-schema/src/protocol/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ use std::str::FromStr;
use relay_common::time;
#[cfg(feature = "jsonschema")]
use relay_jsonschema_derive::JsonSchema;
use relay_protocol::{Annotated, Array, Empty, FromValue, Getter, IntoValue, Object, Val, Value};
use relay_protocol::{
Annotated, Array, Empty, FromValue, Getter, GetterIter, IntoValue, Object, Val, Value,
};
#[cfg(feature = "jsonschema")]
use schemars::{gen::SchemaGenerator, schema::Schema};
use sentry_release_parser::Release as ParsedRelease;
Expand Down Expand Up @@ -653,6 +655,8 @@ impl Getter for Event {
"platform" => self.platform.as_str().unwrap_or("other").into(),

// Fields in top level structures (called "interfaces" in Sentry)
"logentry.formatted" => self.logentry.value()?.formatted.value()?.as_ref().into(),
"logentry.message" => self.logentry.value()?.message.value()?.as_ref().into(),
"user.email" => or_none(&self.user.value()?.email)?.into(),
"user.id" => or_none(&self.user.value()?.id)?.into(),
"user.ip_address" => self.user.value()?.ip_address.as_str()?.into(),
Expand Down Expand Up @@ -805,6 +809,15 @@ impl Getter for Event {
}
})
}

fn get_iter(&self, path: &str) -> Option<GetterIter<'_>> {
Some(match path.strip_prefix("event.")? {
"exception.values" => {
GetterIter::new_annotated(self.exceptions.value()?.values.value()?)
}
_ => return None,
})
}
}

#[cfg(test)]
Expand Down Expand Up @@ -1112,6 +1125,11 @@ mod tests {
})]),
..Default::default()
}),
logentry: Annotated::new(LogEntry {
formatted: Annotated::new("formatted".to_string().into()),
message: Annotated::new("message".to_string().into()),
..Default::default()
}),
request: Annotated::new(Request {
headers: Annotated::new(Headers(PairList(vec![Annotated::new((
Annotated::new("user-agent".into()),
Expand Down Expand Up @@ -1255,6 +1273,23 @@ mod tests {
Some(Val::String("route")),
event.get_value("event.transaction.source")
);

let mut exceptions = event.get_iter("event.exception.values").unwrap();
let exception = exceptions.next().unwrap();
assert_eq!(
Some(Val::String("canvas.contentDocument")),
exception.get_value("value")
);
assert!(exceptions.next().is_none());

assert_eq!(
Some(Val::String("formatted")),
event.get_value("event.logentry.formatted")
);
assert_eq!(
Some(Val::String("message")),
event.get_value("event.logentry.message")
);
}

#[test]
Expand Down
12 changes: 11 additions & 1 deletion relay-event-schema/src/protocol/exception.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#[cfg(feature = "jsonschema")]
use relay_jsonschema_derive::JsonSchema;
use relay_protocol::{Annotated, Empty, FromValue, IntoValue, Object, Value};
use relay_protocol::{Annotated, Empty, FromValue, Getter, IntoValue, Object, Val, Value};

use crate::processor::ProcessValue;
use crate::protocol::{JsonLenientString, Mechanism, RawStacktrace, Stacktrace, ThreadId};
Expand Down Expand Up @@ -72,6 +72,16 @@ pub struct Exception {
pub other: Object<Value>,
}

impl Getter for Exception {
fn get_value(&self, path: &str) -> Option<Val<'_>> {
Some(match path {
"ty" => self.ty.as_str()?.into(),
"value" => self.value.as_str()?.into(),
_ => return None,
})
}
}

#[cfg(test)]
mod tests {
use relay_protocol::Map;
Expand Down
Loading

0 comments on commit 606c6b0

Please sign in to comment.