Skip to content

Commit

Permalink
Merge branch 'master' into pierre/metrics-summaries-let-set-summaries…
Browse files Browse the repository at this point in the history
…-through
  • Loading branch information
phacops authored Jul 25, 2024
2 parents ac54886 + b484598 commit 0baea39
Show file tree
Hide file tree
Showing 13 changed files with 57 additions and 36 deletions.
37 changes: 31 additions & 6 deletions Cargo.lock

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

4 changes: 2 additions & 2 deletions relay-base-schema/src/project.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
//! Contains [`ProjectKey`] and [`ProjectId`] types and necessary traits implementations.
//!
//! - [`ProjectId`] is the unique identifier of a Sentry project. Currently, it is just a wrapper
//! over `u64` and should be considered as implementations details, as it can change in the future.
//! over `u64` and should be considered as implementations details, as it can change in the future.
//! - [`ProjectKey`] is a byte array (`[u8; 32]`) and represents a DSN to identify and authenticate
//! a project at Sentry.
//! a project at Sentry.

use std::error::Error;
use std::fmt;
Expand Down
4 changes: 0 additions & 4 deletions relay-dynamic-config/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use crate::{defaults, ErrorBoundary, MetricExtractionGroup, MetricExtractionGrou
/// [`ProjectConfig`](crate::ProjectConfig)s small.
#[derive(Default, Clone, Debug, Serialize, Deserialize)]
#[serde(default, rename_all = "camelCase")]
#[cfg_attr(feature = "jsonschema", derive(JsonSchema))]
pub struct GlobalConfig {
/// Configuration for measurements normalization.
#[serde(skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -106,7 +105,6 @@ fn is_err_or_empty(filters_config: &ErrorBoundary<GenericFiltersConfig>) -> bool
/// All options passed down from Sentry to Relay.
#[derive(Default, Clone, Debug, Serialize, Deserialize, PartialEq)]
#[serde(default)]
#[cfg_attr(feature = "jsonschema", derive(JsonSchema))]
pub struct Options {
/// List of platform names for which we allow using unsampled profiles for the purpose
/// of improving profile (function) metrics
Expand Down Expand Up @@ -235,7 +233,6 @@ pub struct Options {
/// Kill switch for controlling the cardinality limiter.
#[derive(Default, Clone, Copy, Debug, Serialize, Deserialize, PartialEq)]
#[serde(rename_all = "lowercase")]
#[cfg_attr(feature = "jsonschema", derive(JsonSchema))]
pub enum CardinalityLimiterMode {
/// Cardinality limiter is enabled.
#[default]
Expand All @@ -251,7 +248,6 @@ pub enum CardinalityLimiterMode {

/// Configuration container to control [`BucketEncoding`] per namespace.
#[derive(Debug, Clone, Copy, Default, Serialize, Deserialize, PartialEq)]
#[cfg_attr(feature = "jsonschema", derive(JsonSchema))]
#[serde(default)]
pub struct BucketEncodings {
transactions: BucketEncoding,
Expand Down
1 change: 1 addition & 0 deletions relay-event-normalization/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,4 @@ similar-asserts = { workspace = true }
[features]
default = ["mmap"]
mmap = ["maxminddb/mmap"]
serde = []
1 change: 0 additions & 1 deletion relay-event-normalization/src/normalize/user_agent.rs
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,6 @@ impl<'a> RawUserAgentInfo<&'a str> {
///
/// See <https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers#user_agent_client_hints>
#[derive(Clone, Debug, Default, Deserialize, Serialize, PartialEq)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
pub struct ClientHints<S>
where
S: Default + AsRef<str>,
Expand Down
4 changes: 2 additions & 2 deletions relay-event-schema/src/protocol/debugmeta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ pub struct NativeDebugImage {
/// Unique debug identifier of the image.
///
/// - `elf`: Debug identifier of the dynamic library or executable. If a code identifier is available, the debug identifier is the little-endian UUID representation of the first 16-bytes of that
/// identifier. Spaces are inserted for readability, note the byte order of the first fields:
/// identifier. Spaces are inserted for readability, note the byte order of the first fields:
///
/// ```text
/// code id: f1c3bcc0 2798 65fe 3058 404b2831d9e6 4135386c
Expand Down Expand Up @@ -371,7 +371,7 @@ pub struct NativeDebugImage {
/// The optional checksum of the debug companion file.
///
/// - `pe_dotnet`: This is the hash algorithm and hex-formatted checksum of the associated PDB file.
/// This should have the format `$algorithm:$hash`, for example `SHA256:aabbccddeeff...`.
/// This should have the format `$algorithm:$hash`, for example `SHA256:aabbccddeeff...`.
///
/// See: <https://github.com/dotnet/runtime/blob/main/docs/design/specs/PE-COFF.md#pdb-checksum-debug-directory-entry-type-19>
pub debug_checksum: Annotated<String>,
Expand Down
16 changes: 8 additions & 8 deletions relay-filter/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,19 +272,19 @@ impl GenericFilterConfig {
/// configs yielding the filters according to the principles below:
///
/// - Filters from project configs are evaluated before filters from global
/// configs.
/// configs.
/// - No duplicates: once a filter is evaluated (yielded or skipped), no filter
/// with the same id is evaluated again.
/// with the same id is evaluated again.
/// - Filters in project configs override filters from global configs, but the
/// opposite is never the case.
/// opposite is never the case.
/// - A filter in the project config can be a flag, where only `is_enabled` is
/// defined and `condition` is not. In that case:
/// defined and `condition` is not. In that case:
/// - If `is_enabled` is true, the filter with a matching ID from global
/// configs is yielded without evaluating its `is_enabled`. Unless the filter
/// in the global config also has an empty condition, in which case the filter
/// is not yielded.
/// configs is yielded without evaluating its `is_enabled`. Unless the filter
/// in the global config also has an empty condition, in which case the filter
/// is not yielded.
/// - If `is_enabled` is false, no filters with the same IDs are returned,
/// including matching filters from global configs.
/// including matching filters from global configs.
///
/// # Examples
///
Expand Down
8 changes: 4 additions & 4 deletions relay-filter/src/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ pub(crate) fn should_filter<F: Getter>(
/// If filters are compatible, an iterator over all filters is returned. This
/// iterator yields filters according to the principles below:
/// - Filters from project configs are evaluated before filters from global
/// configs.
/// configs.
/// - No duplicates: once a filter is evaluated (yielded or skipped), no filter
/// with the same id is evaluated again.
/// with the same id is evaluated again.
/// - If a filter with the same id exists in projects and global configs, both
/// are merged and the filter is yielded. Values from the filter in the project
/// config are prioritized.
/// are merged and the filter is yielded. Values from the filter in the project
/// config are prioritized.
fn merge_generic_filters<'a>(
project: &'a GenericFiltersConfig,
global: Option<&'a GenericFiltersConfig>,
Expand Down
2 changes: 1 addition & 1 deletion relay-server/src/extractors/forwarded_for.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ impl ForwardedFor {
///
/// First match wins in order:
/// - [`Self::CLOUDFLARE_FORWARDED_HEADER`], highest priority since users may use Cloudflare
/// infront of Vercel, it is generally the first layer.
/// infront of Vercel, it is generally the first layer.
/// - [`Self::VERCEL_FORWARDED_HEADER`]
/// - [`Self::SENTRY_FORWARDED_HEADER`]
/// - [`Self::FORWARDED_HEADER`].
Expand Down
2 changes: 1 addition & 1 deletion relay-server/src/services/global_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl GlobalConfigService {
/// This function checks two levels of results:
/// 1. Whether the request to the upstream was successful.
/// 2. If the request was successful, it then checks whether the returned
/// global config is valid and contains the expected data.
/// global config is valid and contains the expected data.
fn handle_result(&mut self, result: UpstreamQueryResult) {
match result {
Ok(Ok(response)) => {
Expand Down
6 changes: 3 additions & 3 deletions relay-server/src/services/project_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl CheckEnvelope {
/// next stage:
///
/// - If the envelope needs dynamic sampling, and the project state is not cached or out of the
/// date, the envelopes is spooled and we continue when the state is fetched.
/// date, the envelopes is spooled and we continue when the state is fetched.
/// - Otherwise, the envelope is directly submitted to the [`EnvelopeProcessor`].
///
/// [`EnvelopeProcessor`]: crate::services::processor::EnvelopeProcessor
Expand Down Expand Up @@ -840,9 +840,9 @@ impl ProjectCacheBroker {
///
/// Few conditions are checked here:
/// - If there is no dynamic sampling key and the project is already cached, we do straight to
/// processing otherwise buffer the envelopes.
/// processing otherwise buffer the envelopes.
/// - If the dynamic sampling key is provided and if the root and sampling projects
/// are cached - process the envelope, buffer otherwise.
/// are cached - process the envelope, buffer otherwise.
///
/// This means if the caches are hot we always process all the incoming envelopes without any
/// delay. But in case the project state cannot be fetched, we keep buffering till the state
Expand Down
4 changes: 2 additions & 2 deletions relay-server/src/statsd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -683,9 +683,9 @@ pub enum RelayCounters {
/// - `has_parent` (only for event_type span): `false` if the span is the root of a trace.
/// - `platform` (only for event_type span): The platform from which the span was spent.
/// - `metric_type` (only for event_type metric): The metric type, counter, distribution,
/// gauge or set.
/// gauge or set.
/// - `metric_encoding` (only for event_type metric): The encoding used for distribution and
/// set metrics.
/// set metrics.
///
/// The message types can be:
///
Expand Down
4 changes: 2 additions & 2 deletions relay-server/tests/snapshots/test_fixtures__event_schema.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2569,7 +2569,7 @@ expression: "relay_event_schema::protocol::event_json_schema()"
]
},
"debug_checksum": {
"description": " The optional checksum of the debug companion file.\n\n - `pe_dotnet`: This is the hash algorithm and hex-formatted checksum of the associated PDB file.\n This should have the format `$algorithm:$hash`, for example `SHA256:aabbccddeeff...`.\n\n See: <https://github.com/dotnet/runtime/blob/main/docs/design/specs/PE-COFF.md#pdb-checksum-debug-directory-entry-type-19>",
"description": " The optional checksum of the debug companion file.\n\n - `pe_dotnet`: This is the hash algorithm and hex-formatted checksum of the associated PDB file.\n This should have the format `$algorithm:$hash`, for example `SHA256:aabbccddeeff...`.\n\n See: <https://github.com/dotnet/runtime/blob/main/docs/design/specs/PE-COFF.md#pdb-checksum-debug-directory-entry-type-19>",
"default": null,
"type": [
"string",
Expand All @@ -2589,7 +2589,7 @@ expression: "relay_event_schema::protocol::event_json_schema()"
]
},
"debug_id": {
"description": " Unique debug identifier of the image.\n\n - `elf`: Debug identifier of the dynamic library or executable. If a code identifier is available, the debug identifier is the little-endian UUID representation of the first 16-bytes of that\n identifier. Spaces are inserted for readability, note the byte order of the first fields:\n\n ```text\n code id: f1c3bcc0 2798 65fe 3058 404b2831d9e6 4135386c\n debug id: c0bcc3f1-9827-fe65-3058-404b2831d9e6\n ```\n\n If no code id is available, the debug id should be computed by XORing the first 4096 bytes of the `.text` section in 16-byte chunks, and representing it as a little-endian UUID (again swapping the byte order).\n\n - `pe`: `signature` and `age` of the PDB file. Both values can be read from the CodeView PDB70 debug information header in the PE. The value should be represented as little-endian UUID, with the age appended at the end. Note that the byte order of the UUID fields must be swapped (spaces inserted for readability):\n\n ```text\n signature: f1c3bcc0 2798 65fe 3058 404b2831d9e6\n age: 1\n debug_id: c0bcc3f1-9827-fe65-3058-404b2831d9e6-1\n ```\n\n - `macho`: Identifier of the dynamic library or executable. It is the value of the `LC_UUID` load command in the Mach header, formatted as UUID.",
"description": " Unique debug identifier of the image.\n\n - `elf`: Debug identifier of the dynamic library or executable. If a code identifier is available, the debug identifier is the little-endian UUID representation of the first 16-bytes of that\n identifier. Spaces are inserted for readability, note the byte order of the first fields:\n\n ```text\n code id: f1c3bcc0 2798 65fe 3058 404b2831d9e6 4135386c\n debug id: c0bcc3f1-9827-fe65-3058-404b2831d9e6\n ```\n\n If no code id is available, the debug id should be computed by XORing the first 4096 bytes of the `.text` section in 16-byte chunks, and representing it as a little-endian UUID (again swapping the byte order).\n\n - `pe`: `signature` and `age` of the PDB file. Both values can be read from the CodeView PDB70 debug information header in the PE. The value should be represented as little-endian UUID, with the age appended at the end. Note that the byte order of the UUID fields must be swapped (spaces inserted for readability):\n\n ```text\n signature: f1c3bcc0 2798 65fe 3058 404b2831d9e6\n age: 1\n debug_id: c0bcc3f1-9827-fe65-3058-404b2831d9e6-1\n ```\n\n - `macho`: Identifier of the dynamic library or executable. It is the value of the `LC_UUID` load command in the Mach header, formatted as UUID.",
"anyOf": [
{
"$ref": "#/definitions/DebugId"
Expand Down

0 comments on commit 0baea39

Please sign in to comment.