Skip to content

fix(otel-logs): Fix some issues with otel logs, move expansion into processor - #5136

Merged
Dav1dde merged 2 commits into
masterfrom
dav1d/otlp-logs-processing
Sep 17, 2025
Merged

Dav1dde merged 2 commits into
masterfrom
dav1d/otlp-logs-processing

Conversation

@Dav1dde

@Dav1dde Dav1dde commented Sep 16, 2025 •

Copy link
Copy Markdown
Member

The implementation in #5130 added the expansion right into the processor service, not the logs processor (e.g. how the old implementation did it #5082). This not only means we have to serialize and deserialize an additional time, it also goes against the design where we want to go towards. This was most likely caused by my 'NEL' hack, which I now also separated out again. We can implement a proper NEL processor once we pick up the NEL work again.

The implementation also did not deal with outcomes correctly. This implementation fixes the issues and also introduces RecordKeeper::modify_by to track changes in outcome quantities exactly, instead of just leniently. We can also work towards moving all occurrences of lenient to modify_by in follow-up PRs.

@Dav1dde
Dav1dde force-pushed the dav1d/otlp-logs-processing branch from 2ffd33b to 9de674e Compare September 16, 2025 11:36
@Dav1dde Dav1dde self-assigned this Sep 16, 2025
@Dav1dde
Dav1dde marked this pull request as ready for review September 16, 2025 11:37
@Dav1dde
Dav1dde requested a review from a team as a code owner September 16, 2025 11:37
cursor[bot]

This comment was marked as outdated.

Comment on lines +102 to +103
attribute_data.insert("instrumentation.name".to_owned(), scope.name.clone());
attribute_data.insert("instrumentation.version".to_owned(), scope.version.clone());

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Where do these names come from?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The old code:

if let Some(ref scope) = scope_logs.scope {
if !scope.name.is_empty() {
log_record.attributes.push(KeyValue {
key: "instrumentation.name".to_owned(),
value: Some(AnyValue {
value: Some(Value::StringValue(scope.name.clone())),
}),
})
}
if !scope.version.is_empty() {
log_record.attributes.push(KeyValue {
key: "instrumentation.version".to_owned(),
value: Some(AnyValue {
value: Some(Value::StringValue(scope.version.clone())),
}),
})
}

Comment on lines +64 to +67
let span_id = SpanId::try_from(span_id.as_slice())
.map_or_else(|err| Annotated::from_error(err, None), Annotated::new);
let trace_id = TraceId::try_from(trace_id.as_slice())
.map_or_else(|err| Annotated::from_error(err, None), Annotated::new);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

Comment thread relay-server/src/processing/logs/mod.rs Resolved
@Dav1dde
Dav1dde added this pull request to the merge queue Sep 17, 2025
Merged via the queue into master with commit 67db054 Sep 17, 2025
@Dav1dde
Dav1dde deleted the dav1d/otlp-logs-processing branch September 17, 2025 07:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants