opentelemetry.attributes
- class opentelemetry.attributes.BoundedAttributes(maxlen: int | None = None, attributes: Mapping[str, str | bool | int | float | bytes | Sequence[AnyValue] | Mapping[str, AnyValue] | None] | None = None, immutable: bool = True, max_value_len: int | None = None)[source]
- class opentelemetry.attributes.BoundedAttributes(maxlen: int | None = None, attributes: Mapping[str, str | bool | int | float | bytes | Sequence[AnyValue] | Mapping[str, AnyValue] | None] | None = None, immutable: bool = True, max_value_len: int | None = None, extended_attributes: bool = False)
Bases:
MutableMapping[str,str|bool|int|float|bytes|Sequence[AnyValue] |Mapping[str, AnyValue] |None]A dict with a fixed max capacity which cleans and potentially drops values to ensure they are valid attribute values.
- Parameters:
maxlen (
Optional[int]) – The maximum number of attributes to store, use None for no limit.attributes (
Optional[Mapping[str,UnionType[str,bool,int,float,bytes,Sequence[AnyValue],Mapping[str, AnyValue],None]]]) – The initial attributes to store.immutable (
bool) – Defaults to true. Whether to allow adding/removing of attributes after the initialisation of the instance.max_value_len (
Optional[int]) – The maximum length of string values, use None for no limit.extended_attributes (
bool) – Deprecated. Kept for backwards compatibility. Extended attributes are now always used for attributes everywhere.
When the dict is full and a new element is added, the oldest element is dropped. Attributes are made to be immutable when set in this container. So passing a mutable list as an attribute value, and then mutating it after will not change it’s value in this container.