Skip to content

Commit 3e53ac9

Browse files
authored
Merge branch 'main' into update-http-example
2 parents 8ee0ef0 + c53c5f1 commit 3e53ac9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

opentelemetry-sdk/src/logs/log_emitter.rs

+3
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ pub struct LoggerProvider {
4040

4141
/// Default logger name if empty string is provided.
4242
const DEFAULT_COMPONENT_NAME: &str = "rust.opentelemetry.io/sdk/logger";
43+
// According to a Go-specific study mentioned on https://go.dev/blog/slog,
44+
// up to 5 attributes is the most common case. We have chosen 8 as the default
45+
// capacity for attributes to avoid reallocation in common scenarios.
4346
const PREALLOCATED_ATTRIBUTE_CAPACITY: usize = 8;
4447

4548
impl opentelemetry::logs::LoggerProvider for LoggerProvider {

0 commit comments

Comments
 (0)