Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into ref/server-state-cl…
Browse files Browse the repository at this point in the history
…eanup
  • Loading branch information
jjbayer committed Jul 5, 2024
2 parents ad97f80 + ec7ad6b commit 0fefe75
Show file tree
Hide file tree
Showing 36 changed files with 1,549 additions and 345 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@

**Bug Fixes**:

- 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**:

- Aggregate metrics before rate limiting. ([#3746](https://github.com/getsentry/relay/pull/3746))
- Make sure outcomes for dropped profiles are consistent between indexed and non-indexed categories. ([#3767](https://github.com/getsentry/relay/pull/3767))
- Add web vitals support for mobile browsers. ([#3762](https://github.com/getsentry/relay/pull/3762))
- Accept profiler_id in the profile context. ([#3714](https://github.com/getsentry/relay/pull/3714))
- Ingest profiler_id in the profile context and in spans. ([#3714](https://github.com/getsentry/relay/pull/3714), [#3784](https://github.com/getsentry/relay/pull/3784))
- 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))

## 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$/
4 changes: 4 additions & 0 deletions py/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Unreleased

- Build wheels with manylinux_2_28 and alma linux 8. [#3787](https://github.com/getsentry/relay/pull/3787)

## 0.8.67

### Various fixes & improvements
Expand Down
8 changes: 2 additions & 6 deletions py/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM amd64/centos:7
FROM almalinux:8

# This must be lower case - used in the paths and packages names
ARG TARGET
Expand All @@ -9,11 +9,7 @@ RUN yum -y update \
perl-core openssl openssl-devel pkgconfig libatomic \
&& if [ "$(uname -m)" != ${TARGET} ]; then \
yum install -y "binutils-${TARGET}-linux-gnu" "gcc-${TARGET}-linux-gnu" "gcc-c++-${TARGET}-linux-gnu" \
&& if [ ${TARGET} == "aarch64" ]; then \
curl -L -s https://www.centos.org/keys/RPM-GPG-KEY-CentOS-7-aarch64 > /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 \
&& cat /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7-aarch64 >> /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 ; \
fi \
&& dnf --forcearch "${TARGET}" --release 7 install -y gcc glibc glibc-devel --installroot "/usr/${TARGET}-linux-gnu/sys-root/" || true \
&& dnf --forcearch "${TARGET}" --releasever=8 install -y gcc glibc glibc-devel --installroot "/usr/${TARGET}-linux-gnu/sys-root/" || true \
&& ln -s "/usr/${TARGET}-linux-gnu/sys-root/usr/lib64/libgcc_s.so.1" "/usr/${TARGET}-linux-gnu/sys-root/usr/lib64/libgcc_s.so"; \
fi \
&& yum clean all \
Expand Down
6 changes: 3 additions & 3 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2361,10 +2361,10 @@ impl Config {
mut max_tag_value_length,
mut max_project_key_bucket_bytes,
..
} = AggregatorConfig::from(self.default_aggregator_config());
} = self.default_aggregator_config().aggregator;

for secondary_config in self.secondary_aggregator_configs() {
let agg = &secondary_config.config;
let agg = &secondary_config.config.aggregator;

bucket_interval = bucket_interval.min(agg.bucket_interval);
max_secs_in_past = max_secs_in_past.max(agg.max_secs_in_past);
Expand All @@ -2382,7 +2382,7 @@ impl Config {
.map(|sc| &sc.config)
.chain(std::iter::once(self.default_aggregator_config()))
{
if agg.bucket_interval % bucket_interval != 0 {
if agg.aggregator.bucket_interval % bucket_interval != 0 {
relay_log::error!("buckets don't align");
}
}
Expand Down
21 changes: 3 additions & 18 deletions relay-dynamic-config/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,28 +214,13 @@ pub struct Options {
)]
pub span_extraction_sample_rate: Option<f32>,

/// If true, runs full normalization in non-processing Relays.
///
/// Doesn't apply to processing Relays. Outdated relays with a stale
/// protocol/normalization receiving this flag will not forward unknown
/// fields. Disabling the flag solves this behavior.
#[serde(
default,
rename = "relay.force_full_normalization",
deserialize_with = "default_on_error",
skip_serializing_if = "is_default"
)]
pub force_full_normalization: bool,

/// If true, disables normalization in processing Relays for events
/// normalized in a previous internal relay.
/// Overall sampling of metrics summaries computation.
#[serde(
default,
rename = "relay.disable_normalization.processing",
rename = "relay.compute-metrics-summaries.sample-rate",
deserialize_with = "default_on_error",
skip_serializing_if = "is_default"
)]
pub processing_disable_normalization: bool,
pub compute_metrics_summaries_sample_rate: Option<f32>,

/// The maximum duplication factor used to extrapolate distribution metrics from sampled data.
///
Expand Down
69 changes: 54 additions & 15 deletions relay-event-normalization/src/normalize/contexts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@ static OS_MACOS_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"^Mac OS X (?P<version>\d+\.\d+\.\d+)( \((?P<build>[a-fA-F0-9]+)\))?$").unwrap()
});

/// Format sent by Unity on iOS
static OS_IOS_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"^iOS (?P<version>\d+\.\d+\.\d+)").unwrap());

/// Format sent by Unity on iPadOS
static OS_IPADOS_REGEX: Lazy<Regex> =
Lazy::new(|| Regex::new(r"^iPadOS (?P<version>\d+\.\d+\.\d+)").unwrap());

/// Specific regex to parse Linux distros
static OS_LINUX_DISTRO_UNAME_REGEX: Lazy<Regex> = Lazy::new(|| {
Regex::new(r"^Linux (?P<kernel_version>\d+\.\d+(\.\d+(\.[1-9]+)?)?) (?P<name>[a-zA-Z]+) (?P<version>\d+(\.\d+){0,2})").unwrap()
Expand Down Expand Up @@ -196,6 +204,26 @@ fn normalize_os_context(os: &mut OsContext) {
.name("build")
.map(|m| m.as_str().to_string().into())
.into();
} else if let Some(captures) = OS_IOS_REGEX.captures(raw_description) {
os.name = "iOS".to_string().into();
os.version = captures
.name("version")
.map(|m| m.as_str().to_string())
.into();
os.build = captures
.name("build")
.map(|m| m.as_str().to_string().into())
.into();
} else if let Some(captures) = OS_IPADOS_REGEX.captures(raw_description) {
os.name = "iPadOS".to_string().into();
os.version = captures
.name("version")
.map(|m| m.as_str().to_string())
.into();
os.build = captures
.name("build")
.map(|m| m.as_str().to_string().into())
.into();
} else if let Some(captures) = OS_LINUX_DISTRO_UNAME_REGEX.captures(raw_description) {
os.name = captures.name("name").map(|m| m.as_str().to_string()).into();
os.version = captures
Expand Down Expand Up @@ -609,6 +637,32 @@ mod tests {
assert_eq!(None, os.build.value());
}

#[test]
fn test_unity_ios() {
let mut os = OsContext {
raw_description: "iOS 17.5.1".to_string().into(),
..OsContext::default()
};

normalize_os_context(&mut os);
assert_eq!(Some("iOS"), os.name.as_str());
assert_eq!(Some("17.5.1"), os.version.as_str());
assert_eq!(None, os.build.value());
}

#[test]
fn test_unity_ipados() {
let mut os = OsContext {
raw_description: "iPadOS 17.5.1".to_string().into(),
..OsContext::default()
};

normalize_os_context(&mut os);
assert_eq!(Some("iPadOS"), os.name.as_str());
assert_eq!(Some("17.5.1"), os.version.as_str());
assert_eq!(None, os.build.value());
}

//OS_WINDOWS_REGEX = r#"^(Microsoft )?Windows (NT )?(?P<version>\d+\.\d+\.\d+).*$"#;
#[test]
fn test_unity_windows_os() {
Expand Down Expand Up @@ -669,21 +723,6 @@ mod tests {
assert_eq!(None, os.build.value());
}

#[test]
fn test_ios_15_0() {
let mut os = OsContext {
raw_description: "iOS 15.0".to_string().into(),
..OsContext::default()
};
normalize_os_context(&mut os);
assert_eq!(Some("iOS"), os.name.as_str());

// XXX: This behavior of putting it into kernel_version vs version is probably not desired and
// may be revisited
assert_eq!(Some("15.0"), os.kernel_version.as_str());
assert_eq!(None, os.build.value());
}

#[test]
fn test_infer_json() {
let mut response = ResponseContext {
Expand Down
Loading

0 comments on commit 0fefe75

Please sign in to comment.