Skip to content

Commit

Permalink
Merge branch 'main' into log-clone
Browse files Browse the repository at this point in the history
  • Loading branch information
pellared committed Jul 25, 2024
2 parents c77d7e8 + 5122dee commit 132bf81
Show file tree
Hide file tree
Showing 10 changed files with 134 additions and 81 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,19 @@ release.

### Traces

- Remove restriction that sampler description is immutable.
([#4137](https://github.com/open-telemetry/opentelemetry-specification/pull/4137))

### Metrics

- Clarify prometheus exporter should have `host` and `port` configuration options.
([#4147](https://github.com/open-telemetry/opentelemetry-specification/pull/4147))
- Clarify metric reader / metric exporter relationship for temporality
preference and default aggregation. Explicitly define configuration options
for temporality preference and default aggregation of built-in exporters, and
make default values explicit.
([#4142](https://github.com/open-telemetry/opentelemetry-specification/pull/4142))

### Logs

- The SDK MAY provide an operation that makes a deep clone of a `ReadWriteLogRecord`.
Expand Down
122 changes: 62 additions & 60 deletions spec-compliance-matrix.md

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions specification/logs/event-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,10 @@ logs to have a common format within that structure. When OpenTelemetry
instrumentation emits logs, those logs SHOULD be formatted as Events. All
semantic conventions defined for logs MUST be formatted as Events.

The Event format is as follows. All Events have a `name` attribute, and all
Events with the same `name` MUST conform to the same schema for both their
`Attributes` and their `Body`.
The Event format is as follows. All Events have a
[`event.name` attribute](https://github.com/open-telemetry/semantic-conventions/blob/main/docs/general/events.md),
and all Events with the same `event.name` MUST conform to the same schema for
both their `Attributes` and their `Body`.

## Event API use cases

Expand Down
8 changes: 4 additions & 4 deletions specification/metrics/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -1221,12 +1221,12 @@ determines the following capabilities:
* Handling the [ForceFlush](#forceflush) and [Shutdown](#shutdown) signals from
the SDK.

To construct a `MetricReader` when setting up an SDK, the caller
SHOULD provide at least the following:
To construct a `MetricReader` when setting up an SDK, at least the following
SHOULD be provided:

* The `exporter` to use, which is a `MetricExporter` instance.
* The default output `aggregation` (optional), a function of instrument kind. If not configured, the [default aggregation](#default-aggregation) SHOULD be used.
* The default output `temporality` (optional), a function of instrument kind. If not configured, the Cumulative temporality SHOULD be used.
* The default output `aggregation` (optional), a function of instrument kind. This function SHOULD be obtained from the `exporter`. If not configured, the [default aggregation](#default-aggregation) SHOULD be used.
* The output `temporality` (optional), a function of instrument kind. This function SHOULD be obtained from the `exporter`. If not configured, the Cumulative temporality SHOULD be used.
* **Status**: [Development](../document-status.md) - The default aggregation cardinality limit to use, a function of instrument kind. If not configured, a default value of 2000 SHOULD be used.
* **Status**: [Development](../document-status.md) - The [MetricFilter](#metricfilter) to apply to metrics and attributes during `MetricReader#Collect`.
* Zero of more [MetricProducer](#metricproducer)s (optional) to collect metrics from in addition to metrics from the SDK.
Expand Down
11 changes: 9 additions & 2 deletions specification/metrics/sdk_exporters/in-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,15 @@ In-memory Metrics Exporter is a [Push Metric
Exporter](../sdk.md#push-metric-exporter) which accumulates metrics data in the
local memory and allows to inspect it (useful for e.g. unit tests).

In-memory Metrics Exporter MUST support both Cumulative and Delta
[Temporality](../data-model.md#temporality).
In-memory Metrics Exporter MUST provide configuration to set
the [MetricReader](../sdk.md#metricreader) output `temporality` as a function of
instrument kind. This option MAY be named `temporality`, and MUST set
temporality to Cumulative for all instrument kinds by default.

In-memory Metrics Exporter MAY provide configuration to set
the [MetricReader](../sdk.md#metricreader) default `aggregation` as a function
of instrument kind. This option MAY be named `default_aggregation`, and MUST use
the [default aggregation](../sdk.md#default-aggregation) by default.

If a language provides a mechanism to automatically configure a
[MetricReader](../sdk.md#metricreader) to pair with the associated
Expand Down
21 changes: 14 additions & 7 deletions specification/metrics/sdk_exporters/otlp.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,15 @@ OTLP Metrics Exporter is a [Push Metric
Exporter](../sdk.md#push-metric-exporter) which sends metrics via the
[OpenTelemetry Protocol](../../protocol/README.md).

OTLP Metrics Exporter MUST support both Cumulative and Delta
[Aggregation Temporality](../data-model.md#temporality).
OTLP Metrics Exporter MUST provide configuration to influence
the [MetricReader](../sdk.md#metricreader) output `temporality` as a function of
instrument kind. This option MAY be named `temporality`, and MUST set
temporality preference to Cumulative for all instrument kinds by default.

OTLP Metrics Exporter MUST provide configuration to influence
the [MetricReader](../sdk.md#metricreader) default `aggregation` as a function
of instrument kind. This option MAY be named `default_aggregation`, and MUST set
the [default aggregation](../sdk.md#default-aggregation) for all instrument kinds by default.

The exporter MUST provide configuration according to the [OpenTelemetry Protocol
Exporter](../../protocol/exporter.md) specification.
Expand All @@ -33,12 +40,12 @@ then by default:
* The exporter MUST configure the default aggregation on the basis of instrument kind using
the `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` variable as described below if it is implemented.

## Additional Configuration
## Additional Environment Variable Configuration

| Name | Description | Default |
|------------------------------------------------------------|---------------------------------------------------------------------|-----------------------------|
| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | The aggregation temporality to use on the basis of instrument kind. | `cumulative` |
| `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` | The default aggregation to use for histogram instruments. | `explicit_bucket_histogram` |
| Name | Description | Default |
|------------------------------------------------------------|--------------------------------------------------------------------------------------------------------|-----------------------------|
| `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` | Configure the exporter's aggregation `temporality` option (see above) on the basis of instrument kind. | `cumulative` |
| `OTEL_EXPORTER_OTLP_METRICS_DEFAULT_HISTOGRAM_AGGREGATION` | Configure the exporter's `default_aggregation` option (see above) for Histogram instrument kind. | `explicit_bucket_histogram` |

The recognized (case-insensitive) values for `OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE` are:

Expand Down
17 changes: 17 additions & 0 deletions specification/metrics/sdk_exporters/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,25 @@ A Prometheus Exporter for an OpenTelemetry metrics SDK MUST NOT add
There MUST be at most one `target` info metric exposed by an SDK
Prometheus exporter.

A Prometheus Exporter MUST set
the [MetricReader](../sdk.md#metricreader) `temporality` as a function of
instrument kind to be `cumulative` for all instrument kinds.

## Configuration

A Prometheus Exporter SHOULD support a configuration option to set the host
that metrics are served on. The option MAY be named `host`, and MUST be `localhost`
by default.

A Prometheus Exporter SHOULD support a configuration option to set the port
that metrics are served on. The option MAY be named `port`, and MUST be `9464` by
default.

A Prometheus Exporter SHOULD support a configuration option to set
the [MetricReader](../sdk.md#metricreader) default `aggregation` as a function
of instrument kind. This option MAY be named `default_aggregation`, and MUST use
the [default aggregation](../sdk.md#default-aggregation) by default.

A Prometheus Exporter MAY offer configuration to add resource attributes as metric attributes.
By default, it MUST NOT add any resource attributes as metric attributes.
The configuration SHOULD allow the user to select which resource attributes to copy (e.g.
Expand Down
11 changes: 9 additions & 2 deletions specification/metrics/sdk_exporters/stdout.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,15 @@ stdout/console.
name for their language. For example, ConsoleExporter, StdoutExporter,
StreamExporter, etc.

"Standard output" Metrics Exporter MUST support both Cumulative and Delta
[Temporality](../data-model.md#temporality).
"Standard output" Metrics Exporter MUST provide configuration to set
the [MetricReader](../sdk.md#metricreader) output `temporality` as a function of
instrument kind. This option MAY be named `temporality`, and MUST set
temporality to Cumulative for all instrument kinds by default.

"Standard output" Metrics Exporter MAY provide configuration to set
the [MetricReader](../sdk.md#metricreader) default `aggregation` as a function
of instrument kind. This option MAY be named `default_aggregation`, and MUST use
the [default aggregation](../sdk.md#default-aggregation) by default.

If a language provides a mechanism to automatically configure a
[MetricReader](../sdk.md#metricreader) to pair with the associated
Expand Down
3 changes: 1 addition & 2 deletions specification/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,7 @@ information.
#### Views

[Views](metrics/sdk.md#view) are configurations that specify how the data from an `Instrument` should be processed,
aggregated, and exported. They can be applied globally through the `MeterProvider` or more
specifically at the `Meter` level. A `View` allows the customization of metric data beyond the default
aggregated, and exported. They can be configured through the `MeterProvider`. A `View` allows the customization of metric data beyond the default
collection behavior, enabling specific aggregations, transformations, and filtering of metrics.

## Log Signal
Expand Down
4 changes: 3 additions & 1 deletion specification/trace/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,9 @@ Returns the sampler name or short description with the configuration. This may
be displayed on debug pages or in the logs. Example:
`"TraceIdRatioBased{0.000100}"`.

Description MUST NOT change over time and caller can cache the returned value.
Description MAY change over time, for example, if the sampler supports dynamic
configuration or otherwise adjusts its parameters.
Callers SHOULD NOT cache the returned value.

### Built-in samplers

Expand Down

0 comments on commit 132bf81

Please sign in to comment.