Skip to content

Commit d94b356

Browse files
committed
Restructure log data model to be more like metrics
1 parent ce16301 commit d94b356

File tree

6 files changed

+143
-107
lines changed

6 files changed

+143
-107
lines changed

oteps/0199-support-elastic-common-schema-in-opentelemetry.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ Example of a Nginx Access Log entry structured with ECS
147147

148148
## Principles
149149

150-
| Description | [OTel Logs and Event Record](../specification/logs/data-model.md#log-and-event-record-definition) | [Elastic Common Schema (ECS)](https://www.elastic.co/docs/reference/ecs) |
150+
| Description | [OTel Logs and Event Record](../specification/logs/data-model.md#open-telemetry-protocol-data-model) | [Elastic Common Schema (ECS)](https://www.elastic.co/docs/reference/ecs) |
151151
| ----------- | ------------- | -------- |
152152
| Metadata shared by all the Log Messages / Spans / Metrics of an application instance | Resource Attributes | ECS fields |
153153
| Metadata specific to each Log Message / Span / Metric data point | Attributes | ECS Fields |
@@ -158,7 +158,7 @@ Example of a Nginx Access Log entry structured with ECS
158158

159159
## Data Types
160160

161-
| Category | <a href="../specification/logs/data-model.md#log-and-event-record-definition">OTel Logs and Event Record</a> (all or a subset of <a href="https://protobuf.dev/programming-guides/proto3/">GRPC data types</a>) | <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/field-data-types">ECS Data Types</a> |
161+
| Category | <a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">OTel Logs and Event Record</a> (all or a subset of <a href="https://protobuf.dev/programming-guides/proto3/">GRPC data types</a>) | <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/field-data-types">ECS Data Types</a> |
162162
| --- | --- | --- |
163163
| Text | string | <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/text#text-field-type">text</a>, <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/text#match-only-text-field-type">match_only_text</a>, <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/keyword#keyword-field-type">keyword</a> <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/keyword#constant-keyword-field-type">constant_keyword</a>, <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/keyword#wildcard-field-type">wildcard</a> |
164164
| Dates | uint64 nanoseconds since Unix epoch | <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/date">date</a>, <a href="https://www.elastic.co/docs/reference/elasticsearch/mapping-reference/date_nanos">date_nanos</a> |
@@ -177,23 +177,23 @@ As the markdown code of the tables is hard to read and maintain with very long l
177177

178178
<table>
179179
<tr>
180-
<td><strong><a href="../specification/logs/data-model.md#log-and-event-record-definition">OTel Logs and Event Record</a></strong>
180+
<td><strong><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">OTel Logs and Event Record</a></strong>
181181
</td>
182182
<td><strong><a href="https://www.elastic.co/docs/reference/ecs">Elastic Common Schema (ECS)</a></strong>
183183
</td>
184184
<td><strong>Description</strong>
185185
</td>
186186
</tr>
187187
<tr>
188-
<td><a href="../specification/logs/data-model.md#log-and-event-record-definition">Timestamp</a> (uint64 nanoseconds since Unix epoch)
188+
<td><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">Timestamp</a> (uint64 nanoseconds since Unix epoch)
189189
</td>
190190
<td><a href="https://www.elastic.co/docs/reference/ecs/ecs-base#field-timestamp">@timestamp</a> (date)
191191
</td>
192192
<td>
193193
</td>
194194
</tr>
195195
<tr>
196-
<td><a href="../specification/logs/data-model.md#log-and-event-record-definition">TraceId</a> (byte sequence), <a href="../specification/logs/data-model.md#log-and-event-record-definition">SpanId</a> (byte sequence)
196+
<td><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">TraceId</a> (byte sequence), <a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">SpanId</a> (byte sequence)
197197
</td>
198198
<td><a href="https://www.elastic.co/docs/reference/ecs/ecs-tracing#field-trace-id">trace.id</a> (keyword), <a href="https://www.elastic.co/docs/reference/ecs/ecs-tracing#field-trace-id">span.id</a> (keyword)
199199
</td>
@@ -209,23 +209,23 @@ As the markdown code of the tables is hard to read and maintain with very long l
209209
</td>
210210
</tr>
211211
<tr>
212-
<td><a href="../specification/logs/data-model.md#log-and-event-record-definition">SeverityText</a> (string)
212+
<td><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">SeverityText</a> (string)
213213
</td>
214214
<td><a href="https://www.elastic.co/docs/reference/ecs/ecs-log#field-log-syslog-severity-name">log.syslog.severity.name</a> (keyword), <a href="https://www.elastic.co/docs/reference/ecs/ecs-log#field-log-level">log.level</a> (keyword)
215215
</td>
216216
<td>
217217
</td>
218218
</tr>
219219
<tr>
220-
<td><a href="../specification/logs/data-model.md#log-and-event-record-definition">SeverityNumber</a> (number)
220+
<td><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">SeverityNumber</a> (number)
221221
</td>
222222
<td><a href="https://www.elastic.co/docs/reference/ecs/ecs-log#field-log-syslog-severity-code">log.syslog.severity.code</a>
223223
</td>
224224
<td>
225225
</td>
226226
</tr>
227227
<tr>
228-
<td><a href="../specification/logs/data-model.md#log-and-event-record-definition">Body</a> (any)
228+
<td><a href="../specification/logs/data-model.md#open-telemetry-protocol-data-model">Body</a> (any)
229229
</td>
230230
<td><a href="https://www.elastic.co/docs/reference/ecs/ecs-base#field-message">message</a> (match_only_text)
231231
</td>

specification/logs/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ Logs can be correlated with the rest of observability data in a few dimensions:
196196
- By the **origin of the telemetry**, also known as the Resource context.
197197
OpenTelemetry traces and metrics contain information about the Resource they
198198
come from. We extend this practice to logs by including the
199-
[Resource](data-model.md#field-resource) in LogRecords.
199+
[Resource](../resource/README.md) in Log data streams.
200200

201201
These 3 correlations can be the foundation of powerful navigational, filtering,
202202
querying and analytical capabilities. OpenTelemetry aims to record and collects

specification/logs/api.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ The Logs API consist of these main components:
4343

4444
* [LoggerProvider](#loggerprovider) is the entry point of the API. It provides access to `Logger`s.
4545
* [Logger](#logger) is responsible for emitting logs as
46-
[LogRecords](./data-model.md#log-and-event-record-definition).
46+
[LogRecords](./data-model.md#open-telemetry-protocol-data-model).
4747

4848
```mermaid
4949
graph TD
@@ -67,10 +67,10 @@ The `LoggerProvider` MUST provide the following functions:
6767

6868
#### Get a Logger
6969

70-
This API MUST accept the following [instrumentation scope](data-model.md#field-instrumentationscope)
70+
This API MUST accept the following [instrumentation scope](../common/instrumentation-scope.md)
7171
parameters:
7272

73-
* `name`: Specifies the name of the [instrumentation scope](../common/instrumentation-scope.md),
73+
* `name`: Specifies the name of the instrumentation scope,
7474
such as the [instrumentation library](../glossary.md#instrumentation-library)
7575
(e.g. `io.opentelemetry.contrib.mongodb`), package, module or class name.
7676
If an application or library has built-in OpenTelemetry instrumentation, both

0 commit comments

Comments
 (0)