Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit ca19785

Browse files
author
Tigran Najaryan
committed
Address PR comments
1 parent f6f9d72 commit ca19785

1 file changed

Lines changed: 28 additions & 23 deletions

File tree

text/0097-log-data-model.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ The reasons for having these 2 kinds of fields are:
133133
custom data that the application may want to include in the logs.
134134

135135
When designing this data model we followed the following reasoning to make a
136-
decision about when to use use a top-level named field:
136+
decision about when to use a top-level named field:
137137

138138
- The field needs to be either mandatory for all records or be frequently
139139
present in well-known log and event formats (such as `Timestamp`) or is
@@ -187,43 +187,46 @@ field is optional, it may be missing if the timestamp is unknown.
187187

188188
Type: byte sequence.
189189

190-
Description: Optional request trace id as defined in
190+
Description: Request trace id as defined in
191191
[W3C Trace Context](https://www.w3.org/TR/trace-context/#trace-id). Can be set
192-
for logs that are part of request processing and have an assigned trace id.
192+
for logs that are part of request processing and have an assigned trace id. This
193+
field is optional.
193194

194195
#### Field: `SpanId`
195196

196197
Type: byte sequence.
197198

198-
Description: Optional span id. Can be set for logs that are part of a particular
199-
processing span. If SpanId is present TraceId SHOULD be also present.
199+
Description: Span id. Can be set for logs that are part of a particular
200+
processing span. If SpanId is present TraceId SHOULD be also present. This field
201+
is optional.
200202

201203
#### Field: `TraceFlags`
202204

203205
Type: byte.
204206

205-
Description: Optional trace flag as defined in
207+
Description: Trace flag as defined in
206208
[W3C Trace Context](https://www.w3.org/TR/trace-context/#trace-flags)
207209
specification. At the time of writing the specification defines one flag - the
208-
SAMPLED flag.
210+
SAMPLED flag. This field is optional.
209211

210212
### Severity Fields
211213

212214
#### Field: `SeverityText`
213215

214216
Type: string.
215217

216-
Description: the severity text (also known as log level). This is an optional
217-
field and is the original string representation as it is known at the source. If
218-
this field is missing and `SeverityNumber` is present then the short name that
219-
corresponds to the `SeverityNumber` may be used as a substitution.
218+
Description: severity text (also known as log level). This is the original
219+
string representation of the severity as it is known at the source. If this
220+
field is missing and `SeverityNumber` is present then the short name that
221+
corresponds to the `SeverityNumber` may be used as a substitution. This field is
222+
optional.
220223

221224
#### Field: `SeverityNumber`
222225

223226
Type: number.
224227

225228
Description: numerical value of the severity, normalized to values described in
226-
this document. This is an optional field.
229+
this document. This field is optional.
227230

228231
`SeverityNumber` is an integer number. Smaller numerical values correspond to
229232
less severe events (such as debug events), larger numerical values correspond to
@@ -365,20 +368,21 @@ corresponding short names).
365368

366369
When severity is used in equality or inequality comparisons (for example in
367370
filters in the UIs) the recommendation is to attempt to use both `SeverityText`
368-
and short name of `SeverityNumber` to perform matches. For example if we have a
369-
record with `SeverityText` field equal to "Informational" and `SeverityNumber`
370-
field equal to INFO then it may be preferable from the user experience
371-
perspective to ensure that **severity="Informational"** and **severity="INFO"**
372-
conditions both to are TRUE for that record.
371+
and short name of `SeverityNumber` to perform matches (i.e. equality with either
372+
of these fields should be considered a match). For example if we have a record
373+
with `SeverityText` field equal to "Informational" and `SeverityNumber` field
374+
equal to INFO then it may be preferable from the user experience perspective to
375+
ensure that **severity="Informational"** and **severity="INFO"** conditions both
376+
to are TRUE for that record.
373377

374378
### Field: `ShortName`
375379

376380
Type: string.
377381

378382
Description: Short event identifier that does not contain varying parts.
379383
`ShortName` describes what happened (e.g. "ProcessStarted"). Recommended to be
380-
no longer than 50 characters. Optional. Not guaranteed to be unique in any way.
381-
Typically used for filtering and grouping purposes in backends.
384+
no longer than 50 characters. Not guaranteed to be unique in any way. Typically
385+
used for filtering and grouping purposes in backends. This field is optional.
382386

383387
### Field: `Body`
384388

@@ -388,7 +392,7 @@ Description: A value containing the body of the log record (see the description
388392
of `any` type above). Can be for example a human-readable string message
389393
(including multi-line) describing the event in a free form or it can be a
390394
structured data composed of arrays and maps of other values. Can vary for each
391-
occurrence of the event coming from the same source.
395+
occurrence of the event coming from the same source. This field is optional.
392396

393397
### Field: `Resource`
394398

@@ -404,6 +408,7 @@ Data formats that represent this data model may be designed in a manner that
404408
allows the `Resource` field to be recorded only once per batch of log records
405409
that come from the same source. SHOULD follow OpenTelemetry
406410
[semantic conventions for Resources](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/resource/semantic_conventions).
411+
This field is optional.
407412

408413
### Field: `Attributes`
409414

@@ -414,7 +419,7 @@ of each pair is of `any` type. Unlike the `Resource` field, which is fixed for a
414419
particular source, `Attributes` can vary for each occurrence of the event coming
415420
from the same source. Can contain information about the request context (other
416421
than TraceId/SpanId). SHOULD follow OpenTelemetry
417-
[semantic conventions for Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions).
422+
[semantic conventions for Attributes](https://github.com/open-telemetry/opentelemetry-specification/tree/master/specification/trace/semantic_conventions). This field is optional.
418423

419424
## Example Log Records
420425

@@ -1033,13 +1038,13 @@ All other fields | |
10331038
<td>trace.id</td>
10341039
<td>string</td>
10351040
<td>Trace ID</td>
1036-
<td>trace_id</td>
1041+
<td>TraceId</td>
10371042
</tr>
10381043
<tr>
10391044
<td>span.id*</td>
10401045
<td>string</td>
10411046
<td>Span ID</td>
1042-
<td>span_id</td>
1047+
<td>SpanId</td>
10431048
</tr>
10441049
<tr>
10451050
<td>agent.ephemeral_id</td>

0 commit comments

Comments
 (0)