-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Description
Following #1735, here are a list of improvements we desire in the OTLP ProtoBuffer encoding object of crates/pdata/src/otlp/common.rs
- Ability to encode into a limited-size buffer to avoid unbounded memory use
- Ability to encode into a single pre-allocated &mut [u8]
- Ability to safely truncate long strings appending a "..." or other notice
- Ability to safely truncate a list of top-level fields (e.g., the attributes list of a log record)
- Ability to automatically generate the dropped_attributes_count field of LogRecord, Span, Resource etc by reserving 5 bytes
- Ability to choose (somehow) the number of bytes dedicated to placeholders; the current 4-byte approach is wasteful for small buffers
Ultimately with all of this done we will be able to safely log into pre-allocated buffers and obtain usefully truncated and/or formatted messages without allocating memory inside a tokio tracing event.
Part of #1736
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status