Skip to content

Commit

Permalink
Disable normalization when flushing traces to the agent.
Browse files Browse the repository at this point in the history
  • Loading branch information
hoolioh committed Jun 7, 2024
1 parent ce04a4d commit b0f07f5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 3 deletions.
6 changes: 6 additions & 0 deletions data-pipeline/src/trace_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,16 @@ impl TraceExporter {
},
),
TraceExporterOutputFormat::V07 => {
let mut normalize = false;
if self.endpoint.api_key.is_some() {
normalize = true;
}

let tracer_payload = trace_utils::collect_trace_chunks(
traces,
&header_tags,
|_chunk, _root_span_index| {},
normalize,
);

let endpoint = Endpoint {
Expand Down
2 changes: 1 addition & 1 deletion sidecar/src/service/sidecar_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ impl SidecarServer {
}

let payload =
trace_utils::collect_trace_chunks(traces, &headers, |_chunk, _root_span_index| {});
trace_utils::collect_trace_chunks(traces, &headers, |_chunk, _root_span_index| {}, false);

// send trace payload to our trace flusher
let data = SendData::new(size, payload, headers, target);
Expand Down
1 change: 1 addition & 0 deletions trace-mini-agent/src/trace_processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ impl TraceProcessor for ServerlessTraceProcessor {
obfuscate_span(span, &config.obfuscation_config);
}
},
true
);

let send_data = SendData::new(body_size, payload, tracer_header_tags, &config.trace_intake);
Expand Down
7 changes: 5 additions & 2 deletions trace-utils/src/trace_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ pub fn collect_trace_chunks(
mut traces: Vec<Vec<pb::Span>>,
tracer_header_tags: &TracerHeaderTags,
process_chunk: impl Fn(&mut TraceChunk, usize),
do_normalize: bool,
) -> pb::TracerPayload {
let mut trace_chunks: Vec<pb::TraceChunk> = Vec::new();

Expand All @@ -309,8 +310,10 @@ pub fn collect_trace_chunks(
}
};

if let Err(e) = normalizer::normalize_chunk(&mut chunk, root_span_index) {
error!("Error normalizing trace chunk: {e}");
if do_normalize {
if let Err(e) = normalizer::normalize_chunk(&mut chunk, root_span_index) {
error!("Error normalizing trace chunk: {e}");
}
}

for span in chunk.spans.iter_mut() {
Expand Down

0 comments on commit b0f07f5

Please sign in to comment.