Skip to content

Commit 8601508

Browse files
authored
feat(eap): Produce spans to the items topic (#4735)
1 parent 8eae031 commit 8601508

File tree

4 files changed

+297
-30
lines changed

4 files changed

+297
-30
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Changelog
22

3+
## Unreleased
4+
5+
**Internal**:
6+
7+
- Produce spans to the items topic. ([#4735](https://github.com/getsentry/relay/pull/4735))
8+
39
## 25.6.1
410

511
**Features**:

relay-config/src/config.rs

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1143,6 +1143,9 @@ pub struct Processing {
11431143
pub max_session_secs_in_past: u32,
11441144
/// Kafka producer configurations.
11451145
pub kafka_config: Vec<KafkaConfigParam>,
1146+
/// Configure what span format to produce.
1147+
#[serde(default)]
1148+
pub span_producers: SpanProducers,
11461149
/// Additional kafka producer configurations.
11471150
///
11481151
/// The `kafka_config` is the default producer configuration used for all topics. A secondary
@@ -1200,6 +1203,26 @@ impl Default for Processing {
12001203
attachment_chunk_size: default_chunk_size(),
12011204
projectconfig_cache_prefix: default_projectconfig_cache_prefix(),
12021205
max_rate_limit: default_max_rate_limit(),
1206+
span_producers: Default::default(),
1207+
}
1208+
}
1209+
}
1210+
1211+
/// Configuration for span producers.
1212+
#[derive(Debug, Serialize, Deserialize)]
1213+
#[serde(default)]
1214+
pub struct SpanProducers {
1215+
/// Send JSON spans to `ingest-spans`.
1216+
pub produce_json: bool,
1217+
/// Send Protobuf (TraceItem) to `snuba-items`.
1218+
pub produce_protobuf: bool,
1219+
}
1220+
1221+
impl Default for SpanProducers {
1222+
fn default() -> Self {
1223+
Self {
1224+
produce_json: true,
1225+
produce_protobuf: false,
12031226
}
12041227
}
12051228
}
@@ -2592,6 +2615,16 @@ impl Config {
25922615
let forward = self.values.routing.accept_unknown_items;
25932616
forward.unwrap_or_else(|| !self.processing_enabled())
25942617
}
2618+
2619+
/// Returns `true` if we should produce TraceItem spans on `snuba-items`.
2620+
pub fn produce_protobuf_spans(&self) -> bool {
2621+
self.values.processing.span_producers.produce_protobuf
2622+
}
2623+
2624+
/// Returns `true` if we should produce JSON spans on `ingest-spans`.
2625+
pub fn produce_json_spans(&self) -> bool {
2626+
self.values.processing.span_producers.produce_json
2627+
}
25952628
}
25962629

25972630
impl Default for Config {

relay-kafka/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ define_topic_assignments! {
139139
replay_recordings: (KafkaTopic::ReplayRecordings, "ingest-replay-recordings", "Recordings topic name."),
140140
ourlogs: (KafkaTopic::OurLogs, "snuba-ourlogs", "Logs from our logs product."),
141141
monitors: (KafkaTopic::Monitors, "ingest-monitors", "Monitor check-ins."),
142-
spans: (KafkaTopic::Spans, "snuba-spans", "Standalone spans without a transaction."),
142+
spans: (KafkaTopic::Spans, "ingest-spans", "Standalone spans without a transaction."),
143143
feedback: (KafkaTopic::Feedback, "ingest-feedback-events", "Feedback events topic."),
144144
items: (KafkaTopic::Items, "snuba-items", "Items topic."),
145145
}

0 commit comments

Comments
 (0)