Skip to content

Commit 4a74025

Browse files
jchrostek-ddclaude
andcommitted
chore(otlp): restore explanatory comments for stats processing
Address PR review feedback: - Restore comment explaining stats must be computed after obfuscation - Add comment explaining stats errors are non-critical and logged only 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 99747b8 commit 4a74025

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

bottlecap/src/otlp/agent.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,9 +204,13 @@ impl Agent {
204204
}
205205
}
206206

207+
// This needs to be after process_traces() because process_traces()
208+
// performs obfuscation, and we need to compute stats on the obfuscated traces.
207209
if compute_trace_stats_on_extension
208210
&& let Err(err) = stats_generator.send(&processed_traces)
209211
{
212+
// Just log the error. We don't think trace stats are critical, so we don't want to
213+
// return an error if only stats fail to send.
210214
error!("OTLP | Error sending traces to the stats concentrator: {err}");
211215
}
212216

bottlecap/src/otlp/grpc_agent.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,12 @@ impl TraceService for OtlpGrpcService {
8080
debug!("OTLP gRPC | Successfully buffered traces to be aggregated.");
8181
}
8282

83+
// Compute stats after process_traces() which performs obfuscation.
8384
if compute_trace_stats_on_extension
8485
&& let Err(err) = self.stats_generator.send(&processed_traces)
8586
{
87+
// Just log the error. We don't think trace stats are critical, so we don't want to
88+
// return an error if only stats fail to send.
8689
error!("OTLP gRPC | Error sending traces to the stats concentrator: {err}");
8790
}
8891

0 commit comments

Comments
 (0)