Skip to content

Commit

Permalink
Merge branch 'main' into reyang/metrics-sdk-clarify-metric-type
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Nov 11, 2021
2 parents cd06d96 + 3738bed commit a405c96
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ release.

- Fix Syslog severity number mapping in the example.
([#2091](https://github.com/open-telemetry/opentelemetry-specification/pull/2091))
- Add log.* attributes.
([#2022](https://github.com/open-telemetry/opentelemetry-specification/pull/2022))

### Resource

Expand Down
13 changes: 13 additions & 0 deletions spec-compliance-matrix.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,18 @@ Disclaimer: this list of features is still a work in progress, please refer to t
| The metrics exporter `ForceFlush` can inform the caller whether it succeeded, failed or timed out. | | | | | | | | | | | + | |
| The metrics exporter provides a `shutdown` function. | | + | + | | | | | | | | + | |
| The metrics exporter `shutdown` function do not block indefinitely. | | + | - | | | | | | | | + | |
| The metrics SDK samples `Exemplar`s from measurements. | | | | | | | | | | | | |
| Exemplar sampling can be disabled. | | | | | | | | | | | | |
| The metrics SDK samples measurements in the context of a sampled trace by default. | | | | | | | | | | | | |
| Exemplars retain any attributes available in the measurement that are not preserved by aggregation or view configuration. | | | | | | | | | | | | |
| Exemplars contain the associated trace id and span id of the active span in the Context when the measurement was taken. | | | | | | | | | | | | |
| Exemplars contain the timestamp when the measurement was taken. | | | | | | | | | | | | |
| The metrics SDK provides an `ExemplarReservoir` interface or extension point. | X | | | | | | | | | | | |
| An `ExemplarReservoir` has an `offer` method with access to the measurement value, attributes, `Context` and timestamp. | X | | | | | | | | | | | |
| The metrics SDK provides a `SimpleFixedSizeExemplarReservoir` that is used by default for all aggregations except `ExplicitBucketHistogram`. | | | | | | | | | | | | |
| The metrics SDK provides an `AlignedHistogramBucketExemplarReservoir` that is used by default for `ExplicitBucketHistogram` aggregation. | | | | | | | | | | | | |
| The metrics SDK provides an `ExemplarFilter` interface or extension point. | X | | | | | | | | | | | |
| An `ExemplarFilter` has access to the measurement value, attributes, `Context` and timestamp. | X | | | | | | | | | | | |

## Resource

Expand Down Expand Up @@ -245,6 +257,7 @@ Note: Support for environment variables is optional.
|OTEL_TRACES_SAMPLER_ARG | - | + | | + | + | + | | - | - | | |
|OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT | | | | | | | | | | | |
|OTEL_ATTRIBUTE_COUNT_LIMIT | | | | | | | | | | | |
|OTEL_METRICS_EXEMPLAR_FILTER | | | | | | | | | | | |

## Exporters

Expand Down
4 changes: 2 additions & 2 deletions specification/logs/data-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -426,8 +426,8 @@ Description: Additional information about the specific event occurrence. Unlike
the `Resource` field, which is fixed for a particular source, `Attributes` can
vary for each occurrence of the event coming from the same source. Can contain
information about the request context (other than TraceId/SpanId). SHOULD follow
OpenTelemetry
[semantic conventions for Attributes](../trace/semantic_conventions/README.md).
OpenTelemetry [semantic conventions for Log Attributes](./semantic_conventions/README.md) or
[semantic conventions for Span Attributes](../trace/semantic_conventions/README.md).
This field is optional.

#### Errors and Exceptions
Expand Down
11 changes: 11 additions & 0 deletions specification/logs/semantic_conventions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Log Attribute Semantic Conventions

**Status**: [Experimental](../../document-status.md)

The following semantic conventions for logs are defined:

* [Log Media](media.md): Semantic attributes that may be used in describing the source of a log.

Apart from semantic conventions for logs, [traces](../../trace/semantic_conventions/README.md), and [metrics](../../metrics/semantic_conventions/README.md),
OpenTelemetry also defines the concept of overarching [Resources](../../resource/sdk.md) with their own
[Resource Semantic Conventions](../../resource/semantic_conventions/README.md).
40 changes: 40 additions & 0 deletions specification/logs/semantic_conventions/media.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Semantic Conventions for Log Media

**Status**: [Experimental](../../document-status.md)

This document describes attributes for log media in OpenTelemetry. Log media are mechanisms by which logs are transmitted. Types of media include files, streams, network protocols, and os-specific logging services such as journald and Windows Event Log.

<!-- Re-generate TOC with `markdown-toc --no-first-h1 -i` -->

<!-- toc -->

- [Log Media](#log-media)
* [Log File](#log-file)
* [I/O Stream](#io-stream)

<!-- tocstop -->

## Log Media

**Note:** The OpenTelemetry specification defines a [Resource](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/resource/sdk.md#resource-sdk) as `an immutable representation of the entity producing telemetry`.
The following attributes do not describe entities that produce telemetry. Rather, they describe mechanisms of log transmission.
As such, these should be recorded as Log Record attributes when applicable. They should not be recorded as Resource attributes.

### Log File

**Description:** A file to which log was emitted.

| Name | Notes and examples |
| ------------------------------- | ---------------------------------------------------------------------------------------- |
| `log.file.name` | The basename of the file. Example: `audit.log` |
| `log.file.path` | The full path to the file. Example: `/var/log/mysql/audit.log` |
| `log.file.name_resolved` | The basename of the file, with symlinks resolved. Example: `uuid.log` |
| `log.file.path_resolved` | The full path to the file, with symlinks resolved. Example: `/var/lib/docker/uuid.log` |

### I/O Stream

**Description:** The I/O stream to which the log was emitted.

| Name | Notes and examples |
| ------------------------------- | ---------------------------------------------------------------------------------------- |
| `log.iostream` | The stream associated with the log. SHOULD be one of: `stdout`, `stderr` |

0 comments on commit a405c96

Please sign in to comment.