Skip to content

Commit 8438828

Browse files
committed
Updated baggage constants to the latest standard
1 parent 02cac17 commit 8438828

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

opentelemetry/src/baggage.rs

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,7 @@ use std::fmt;
2222

2323
static DEFAULT_BAGGAGE: Lazy<Baggage> = Lazy::new(Baggage::default);
2424

25-
const MAX_KEY_VALUE_PAIRS: usize = 180;
26-
const MAX_BYTES_FOR_ONE_PAIR: usize = 4096;
25+
const MAX_KEY_VALUE_PAIRS: usize = 64;
2726
const MAX_LEN_OF_ALL_PAIRS: usize = 8192;
2827

2928
/// A set of name/value pairs describing user-defined properties.
@@ -44,11 +43,10 @@ const MAX_LEN_OF_ALL_PAIRS: usize = 8192;
4443
///
4544
/// ### Limits
4645
///
47-
/// * Maximum number of name/value pairs: `180`.
48-
/// * Maximum number of bytes per a single name/value pair: `4096`.
46+
/// * Maximum number of name/value pairs: `64`.
4947
/// * Maximum total length of all name/value pairs: `8192`.
5048
///
51-
/// [RFC2616, Section 2.2]: https://tools.ietf.org/html/rfc2616#section-2.2
49+
/// https://www.w3.org/TR/baggage/#limits
5250
#[derive(Debug, Default)]
5351
pub struct Baggage {
5452
inner: HashMap<Key, (Value, BaggageMetadata)>,
@@ -154,9 +152,6 @@ impl Baggage {
154152
}
155153
let entry_content_len =
156154
key_value_metadata_bytes_size(key.as_str(), value.as_str().as_ref(), metadata.as_str());
157-
if entry_content_len >= MAX_BYTES_FOR_ONE_PAIR {
158-
return None;
159-
}
160155
let entries_count = self.inner.len();
161156
match self.inner.entry(key) {
162157
Entry::Occupied(mut occupied_entry) => {

0 commit comments

Comments
 (0)