-
Notifications
You must be signed in to change notification settings - Fork 932
Description
Is there a clear distinction between what belongs in a structured Body
vs. in Attributes
? If there's not, it seems to make it less predictable where data is expected, and how to map between other models.
A top-level "message" string seems to be pretty common among other log data models. In this model, if you want to have a top-level message string and structured data describing the event, are you supposed to put the message in Body
and other data that would otherwise be in Body
in Attributes
? I don't see anything about special-casing a property of Body
as a top-level message.
From the mapping perspective, considering the Elastic Common Schema (ECS) example, it doesn't include all ECS fields, but message
is the only one shown as mapping to Body
. Body
seems like a logical (perhaps the most logical) place for fields like error.message
or event.id
. So the fact that fields like error.message
are shown as mapping into Attributes
makes it seem that there's not a clear distinction, and that the mapping could be ambiguous depending on whether message
is populated.
(BTW, unlike most of the rest of the document, the ECS example refers to "body" and "attributes" rather than "Body" and "Attributes", which I assume is a typo or holdover from a previous version.)
Attributes
is documented as:
SHOULD follow OpenTelemetry semantic conventions for Attributes.
If I understand correctly, that means that a property of Attributes
that has the name of a well-known attribute should have the meaning and data type defined for that attribute, but meanwhile Attributes
can also include arbitrary custom attributes.
That also seems to have implications for placement of data within Body
vs. Attributes
, because whereas no semantic conventions apply to Body
, if a property gets bumped from Body
into Attributes
, then it may be that conventions are supposed to apply that wouldn't otherwise.