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): Add data categories for log ingestion #4455

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## Unreleased
- Add data categories for LogItem and LogByte. ([#4455](https://github.com/getsentry/relay/pull/4455))
k-fish marked this conversation as resolved.
Show resolved Hide resolved

## 25.1.0

**Internal**
Expand Down
2 changes: 2 additions & 0 deletions py/sentry_relay/consts.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class DataCategory(IntEnum):
REPLAY_VIDEO = 20
UPTIME = 21
ATTACHMENT_ITEM = 22
LOG_ITEM = 23
LOG_BYTE = 24
UNKNOWN = -1
# end generated

Expand Down
13 changes: 13 additions & 0 deletions relay-base-schema/src/data_category.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ pub enum DataCategory {
Uptime = 21,
/// Counts the number of individual attachments, as opposed to the number of bytes in an attachment.
AttachmentItem = 22,
/// LogItem
///
/// This is the category for logs for which we store the count log events for users for measuring
/// missing breadcrumbs, and count of logs for rate limiting purposes.
LogItem = 23,
/// LogByte
///
/// This is the category for logs for which we store log event total bytes for users.
LogByte = 24,
//
// IMPORTANT: After adding a new entry to DataCategory, go to the `relay-cabi` subfolder and run
// `make header` to regenerate the C-binding. This allows using the data category from Python.
Expand Down Expand Up @@ -120,6 +129,8 @@ impl DataCategory {
"transaction_indexed" => Self::TransactionIndexed,
"monitor" => Self::Monitor,
"span" => Self::Span,
"log_item" => Self::LogItem,
"log_byte" => Self::LogByte,
"monitor_seat" => Self::MonitorSeat,
"feedback" => Self::UserReportV2,
"user_report_v2" => Self::UserReportV2,
Expand Down Expand Up @@ -152,6 +163,8 @@ impl DataCategory {
Self::TransactionIndexed => "transaction_indexed",
Self::Monitor => "monitor",
Self::Span => "span",
Self::LogItem => "log_item",
Self::LogByte => "log_byte",
Self::MonitorSeat => "monitor_seat",
Self::UserReportV2 => "feedback",
Self::MetricBucket => "metric_bucket",
Expand Down
17 changes: 15 additions & 2 deletions relay-cabi/include/relay.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#ifndef RELAY_H_INCLUDED
#define RELAY_H_INCLUDED

/* Generated with cbindgen:0.26.0 */
/* Generated with cbindgen:0.27.0 */

/* Warning, this file is autogenerated. Do not modify this manually. */

Expand Down Expand Up @@ -142,6 +142,19 @@ enum RelayDataCategory {
* Counts the number of individual attachments, as opposed to the number of bytes in an attachment.
*/
RELAY_DATA_CATEGORY_ATTACHMENT_ITEM = 22,
/**
* LogCount
*
* This is the category for logs for which we store the count log events for users for measuring
* missing breadcrumbs, and count of logs for rate limiting purposes.
*/
RELAY_DATA_CATEGORY_LOG_ITEM = 23,
/**
* LogBytes
*
* This is the category for logs for which we store log event total bytes for users.
*/
RELAY_DATA_CATEGORY_LOG_BYTE = 24,
/**
* Any other data category not known by this Relay.
*/
Expand Down Expand Up @@ -679,4 +692,4 @@ struct RelayStr normalize_cardinality_limit_config(const struct RelayStr *value)
*/
struct RelayStr relay_normalize_global_config(const struct RelayStr *value);

#endif /* RELAY_H_INCLUDED */
#endif /* RELAY_H_INCLUDED */
2 changes: 2 additions & 0 deletions relay-quotas/src/quota.rs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ impl CategoryUnit {
| DataCategory::ProfileIndexed
| DataCategory::TransactionProcessed
| DataCategory::TransactionIndexed
| DataCategory::LogItem
| DataCategory::LogByte
| DataCategory::Span
| DataCategory::SpanIndexed
| DataCategory::MonitorSeat
Expand Down
Loading