Skip to content

Commit 3aa693a

Browse files
committed
Fix incorrect attributes budget return
Signed-off-by: Brian L. Troutwine <brian.troutwine@datadoghq.com>
1 parent cdda888 commit 3aa693a

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

lading_payload/src/opentelemetry/log/templates.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,13 @@ impl<'a> crate::SizedGenerator<'a> for LogTemplateGenerator {
9494
if inner_budget == original_budget {
9595
return Err(GeneratorError::SizeExhausted);
9696
}
97+
// If attribute population was partial -- signaled by
98+
// inner_budget being drawn down on -- we return the budget back
99+
// and live with no attributes. We do this because OTLP is
100+
// expensive to generate and we may be able to create a
101+
// reasonable instance of a `LogRecord` with the budget
102+
// otherwise on hand.
103+
inner_budget = original_budget;
97104
Vec::new()
98105
}
99106
Err(e) => return Err(e),

0 commit comments

Comments
 (0)