Skip to content

Conversation

@AbhiPrasad
Copy link
Member

@AbhiPrasad AbhiPrasad commented Nov 26, 2025

This is WIP

ref getsentry/sentry#91727
ref https://devcenter.heroku.com/articles/log-drains#https-drains

I still need to:

  • Update the sentry conventions with these new attributes
  • Do some more testing with the logplex parsing
  • Add an integration test (note that Heroku doesn't support attaching headers, so we need to use query param auth)

If anyone wants to do any early reviews, feel free to take a look at relay-ourlogs/src/heroku_to_sentry.rs and relay-server/src/processing/logs/integrations/heroku.rs. That needs the most scrutiny.

@AbhiPrasad AbhiPrasad self-assigned this Nov 26, 2025
@AbhiPrasad AbhiPrasad force-pushed the abhi-heroku-log-drain branch 4 times, most recently from 7e52c00 to dcc11e8 Compare November 27, 2025 16:47
@AbhiPrasad AbhiPrasad force-pushed the abhi-heroku-log-drain branch from dcc11e8 to fa715cd Compare November 27, 2025 17:14
}

Ok((
"",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this correct? The rsyslog crate seems to handle the remainders differently, e.g. in LineRaw.

relay-otel = { workspace = true }
relay-protocol = { workspace = true }
relay-common = { workspace = true }
rsyslog = { workspace = true }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Crate doesn't seem to be adopted nor polished (e.g. docs), need to make sure it satisfies our requirements regarding panics etc.

On a first glance it seems good though.

pub fn as_i64(&self) -> Option<i64> {
match self {
Value::I64(v) => Some(*v),
Value::U64(v) => Some(*v as i64),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This wraps from positive into negative, I think a fundamental method like this one should opt to return None instead .try_into().ok(). If you need wrapping behaviour I'd do it explicitly on the caller side.


async fn handle(
content_type: RawContentType,
headers: HeaderMap,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's fine, but I think it'd be nice to extract the specific headers with a custom type and FromRequestParts impl.

/// Configures the [`Integration`] type with additional headers.
///
/// Headers are stored in the item's `other` field and can be retrieved
/// during processing via `item.get_header()`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/// during processing via `item.get_header()`.
/// during processing via [`Item::get_header`].

let value = headers.get(header.http_header_name())?.to_str().ok()?;
Some((header.as_str().to_owned(), Value::String(value.to_owned())))
})
.collect();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Untested, but with_type_and_headers takes IntoIterator, which means there shouldn't be a need to collect().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants