Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ourlogs): Preliminary breadcrumb to log conversion #4479

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- Preliminary breadcrumb to log conversion. ([#4479](https://github.com/getsentry/relay/pull/4479))
k-fish marked this conversation as resolved.
Show resolved Hide resolved
- Allow log ingestion behind a flag, only for internal use currently. ([#4471](https://github.com/getsentry/relay/pull/4471))

**Features**:
Expand Down
1 change: 1 addition & 0 deletions Cargo.lock

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

11 changes: 11 additions & 0 deletions relay-config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,11 @@ pub struct Limits {
///
/// Defaults to `1024`, a value [google has been using for a long time](https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=19f92a030ca6d772ab44b22ee6a01378a8cb32d4).
pub tcp_listen_backlog: u32,
/// The maximum number of breadcrumbs to convert to OurLogs.
///
/// When converting breadcrumbs to OurLogs, only up to this many breadcrumbs will be converted.
/// Defaults to 100.
pub max_breadcrumbs_converted: usize,
k-fish marked this conversation as resolved.
Show resolved Hide resolved
}

impl Default for Limits {
Expand Down Expand Up @@ -699,6 +704,7 @@ impl Default for Limits {
idle_timeout: None,
max_connections: None,
tcp_listen_backlog: 1024,
max_breadcrumbs_converted: 100,
}
}
}
Expand Down Expand Up @@ -2510,6 +2516,11 @@ impl Config {
let forward = self.values.routing.accept_unknown_items;
forward.unwrap_or_else(|| !self.processing_enabled())
}

/// Returns the maximum number of breadcrumbs that should be converted to OurLogs.
pub fn max_breadcrumbs_converted(&self) -> usize {
self.values.limits.max_breadcrumbs_converted
}
}

impl Default for Config {
Expand Down
12 changes: 12 additions & 0 deletions relay-dynamic-config/src/global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,18 @@ pub struct Options {
)]
pub span_extraction_sample_rate: Option<f32>,

/// Extract logs from breadrumbs for a fraction of sent breadcrumbs.
///
/// `None` is the default and interpreted as extract nothing.
///
/// Note: Any value below 1.0 will cause the product to break, so use with caution.
#[serde(
rename = "relay.ourlogs-breadcrumb-extraction.sample-rate",
deserialize_with = "default_on_error",
skip_serializing_if = "is_default"
)]
pub ourlogs_breadcrumb_extraction_sample_rate: Option<f32>,

/// List of values on span description that are allowed to be sent to Sentry without being scrubbed.
///
/// At this point, it doesn't accept IP addresses in CIDR format.. yet.
Expand Down
1 change: 1 addition & 0 deletions relay-ourlogs/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ opentelemetry-proto = { workspace = true, features = [
"with-serde",
"logs",
] }
relay-log = { workspace = true }
relay-event-schema = { workspace = true }
relay-protocol = { workspace = true }
serde_json = { workspace = true }
Expand Down
1 change: 1 addition & 0 deletions relay-ourlogs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
html_favicon_url = "https://raw.githubusercontent.com/getsentry/relay/master/artwork/relay-icon.png"
)]

pub use crate::ourlog::breadcrumbs_to_ourlogs;
pub use crate::ourlog::otel_to_sentry_log;

pub use opentelemetry_proto::tonic::logs::v1::LogRecord as OtelLog;
Expand Down
Loading
Loading