Skip to content

Logs API and SDK: logs attributes are allowed to have AnyValue values  #4315

Open
@lmolkova

Description

Spec requires log API to support any in attribute types https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#field-attributes

The log attribute model MUST support any type,
a superset of standard Attribute,
to preserve the semantics of structured attributes emitted by the applications.

LogRecord uses the same Attributes type as other signals and does not support any attribute value

AttributeValue = Union[
str,
bool,
int,
float,
Sequence[str],
Sequence[bool],
Sequence[int],
Sequence[float],
]

The recommendation is to:

  1. Keep supporting standard Attributes - see Attributes "hell" opentelemetry-specification#4201 for the context
  2. Add log-specific attributes type that can take anyvalue and accept it as well

As long as p2 can be done incrementally, the lack of it should not block logs API/SDK stability.
It might, however block stability of logging handler bridge which should be able to create anyvalue attributes.

Part of open-telemetry/community#1751

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions