Skip to content

Commit

Permalink
Merge branch 'main' into fix_config_reccursive_env
Browse files Browse the repository at this point in the history
  • Loading branch information
marcalff authored Mar 29, 2024
2 parents 42a27d2 + 40aaf16 commit 88e1639
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 30 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,17 @@ release.

- Clarify that exemplar reservoir default may change in a minor version.
([#3943](https://github.com/open-telemetry/opentelemetry-specification/pull/3943))
- Add option to disable target info metric to Prometheus exporters.
([#3872](https://github.com/open-telemetry/opentelemetry-specification/pull/3872))

### Logs

- Refine description of Instrumentation Scope.
([#3855](https://github.com/open-telemetry/opentelemetry-specification/pull/3855))
- Clarify that `ReadableLogRecord` and `ReadWriteLogRecord` can be represented using a single type.
([#3898](https://github.com/open-telemetry/opentelemetry-specification/pull/3898))
- Fix what can be modified via `ReadWriteLogRecord`.
([#3907](https://github.com/open-telemetry/opentelemetry-specification/pull/3907))

### Events

Expand All @@ -35,6 +39,8 @@ release.
([#3871](https://github.com/open-telemetry/opentelemetry-specification/pull/3871))
- Prometheus compatibility: Clarify that the service triplet is required to be unique by semantic conventions.
([#3945](https://github.com/open-telemetry/opentelemetry-specification/pull/3945))
- Update and reorganize the prometheus sdk exporter specification.
([#3872](https://github.com/open-telemetry/opentelemetry-specification/pull/3872))

### SDK Configuration

Expand Down
16 changes: 8 additions & 8 deletions specification/compatibility/prometheus_and_openmetrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ in keys).

### Metric Metadata

Prometheus SDK exporters MUST NOT allow duplicate UNIT, HELP, or TYPE
Prometheus Pull exporters MUST NOT allow duplicate UNIT, HELP, or TYPE
comments for the same metric name to be returned in a single scrape of the
Prometheus endpoint. Exporters MUST drop entire metrics to prevent conflicting
TYPE comments, but SHOULD NOT drop metric points as a result of conflicting
Expand Down Expand Up @@ -408,16 +408,16 @@ Prometheus exemplar unless they would exceed the

### Resource Attributes

In SDK Prometheus (pull) exporters, resource attributes SHOULD be converted to
a single [`target` info metric](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#supporting-target-metadata-in-both-push-based-and-pull-based-systems)
In Prometheus exporters, an OpenTelemetry Resource SHOULD be converted to
a [`target` info metric](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#supporting-target-metadata-in-both-push-based-and-pull-based-systems)
if the resource is not [empty](../resource/sdk.md#the-empty-resource).
The resource attributes MAY be copied to labels of exported metric families
The Resource attributes MAY be copied to labels of exported metric families
if required by the exporter configuration, or MUST be dropped. The `target`
info metric MUST be an info-typed metric whose labels MUST include the resource
attributes, and MUST NOT include any other labels. There MUST be at most one
`target` info metric exposed on an SDK Prometheus endpoint.
info metric MUST be an info-typed
metric whose labels MUST include the resource attributes, and MUST NOT include
any other labels.

In the Collector's Prometheus pull and push (remote-write) exporters, it is
In the Collector's Prometheus exporters, it is
possible for metrics from multiple targets to be sent together, so targets must
be disambiguated from one another. However, the Prometheus exposition format
and [remote-write](https://github.com/Prometheus/Prometheus/blob/main/prompb/remote.proto)
Expand Down
19 changes: 14 additions & 5 deletions specification/logs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,20 @@ and `ReadWriteLogRecord`.

### ReadWriteLogRecord

A function receiving this as an argument MUST be able to write to the
full [LogRecord](data-model.md#log-and-event-record-definition) and additionally MUST be able to retrieve all
information
that was added to the `LogRecord` (as with
[ReadableLogRecord](#readablelogrecord)).
ReadWriteLogRecord is a superset of [ReadableLogRecord](#readablelogrecord).

A function receiving this as an argument MUST additionally be able to modify
the following information added to the [LogRecord](data-model.md#log-and-event-record-definition):

* [`Timestamp`](./data-model.md#field-timestamp)
* [`ObservedTimestamp`](./data-model.md#field-observedtimestamp)
* [`SeverityText`](./data-model.md#field-severitytext)
* [`SeverityNumber`](./data-model.md#field-severitynumber)
* [`Body`](./data-model.md#field-body)
* [`Attributes`](./data-model.md#field-attributes) (addition, modification, removal)
* [`TraceId`](./data-model.md#field-traceid)
* [`SpanId`](./data-model.md#field-spanid)
* [`TraceFlags`](./data-model.md#field-traceflags)

## LogRecord Limits

Expand Down
51 changes: 34 additions & 17 deletions specification/metrics/sdk_exporters/prometheus.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,54 @@ linkTitle: Prometheus

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

A Prometheus Exporter is a [Pull Metric Exporter](../sdk.md#pull-metric-exporter)
which reports metrics by responding to the [Prometheus](https://prometheus.io/)
scraper requests.
A Prometheus Exporter MUST be a [Pull Metric Exporter](../sdk.md#pull-metric-exporter)
which responds to HTTP requests with Prometheus metrics in the appropriate format.

A Prometheus Exporter MUST support [Pull mode](../sdk.md#pull-metric-exporter).
OpenTelemetry metrics MUST be converted to Prometheus metrics according to the
[Prometheus Compatibility specification](../../compatibility/prometheus_and_openmetrics.md).

A Prometheus Exporter MUST NOT support [Push
mode](../sdk.md#push-metric-exporter).
A Prometheus Exporter SHOULD use
[Prometheus client libraries](https://prometheus.io/docs/instrumenting/clientlibs/)
for serving Prometheus metrics. This allows the prometheus client to negotiate
the [format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md)
of the response using the `Content-Type` header. If a prometheus client library
is used, the OpenTelemetry Prometheus Exporter SHOULD be modeled as a
[custom Collector](https://prometheus.io/docs/instrumenting/writing_clientlibs/#overall-structure)
so it can be used in conjunction with existing Prometheus instrumentation.

A Prometheus Exporter MUST only support [Cumulative
Temporality](../data-model.md#temporality).
Regardless of whether a Prometheus client library is used, the Prometheus
Exporter MUST support version `0.0.4` of the
[Text-based format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format).
A Prometheus Exporter MAY support Exemplars and Exponential Histograms,
which are [not currently supported by the Prometheus text format](../../compatibility/prometheus_and_openmetrics.md#differences-between-prometheus-formats),
by supporting other Protocols, but is not required to implement them.

A Prometheus Exporter MUST support version `0.0.4` of the [Text-based
format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#text-based-format).
A Prometheus Exporter for an OpenTelemetry metrics SDK MUST NOT use
[Prometheus Remote Write format](https://github.com/prometheus/prometheus/blob/main/prompb/remote.proto)
or [OpenMetrics protobuf format](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#protobuf-format).

A Prometheus Exporter MAY support [OpenMetrics Text
Format](https://github.com/prometheus/docs/blob/main/content/docs/instrumenting/exposition_formats.md#openmetrics-text-format),
including the
[Exemplars](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#exemplars).
A Prometheus Exporter for an OpenTelemetry metrics SDK MUST NOT add
[explicit timestamps on Metric points](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#metric).

There MUST be at most one `target` info metric exposed by an SDK
Prometheus exporter.

## Configuration

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.
include / exclude or regular expression based). Copied Resource attributes MUST NOT be
excluded from target_info.
excluded from the `target` info metric.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [unit suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata)
or UNIT metadata. The option MAY be named `without_units`, and MUST be `false` by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [type suffix](../../compatibility/prometheus_and_openmetrics.md#metric-metadata).
The option MAY be named `without_type_suffix`, and MUST be `false` by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [scope info](../../compatibility/prometheus_and_openmetrics.md#instrumentation-scope)
metric. The option MAY be named `without_scope_info`, and MUST be `false` by default.
A Prometheus Exporter MAY support a configuration option to produce metrics without a [scope info](../../compatibility/prometheus_and_openmetrics.md#instrumentation-scope-1)
metric, or scope labels. The option MAY be named `without_scope_info`, and MUST be `false` by default.

A Prometheus Exporter MAY support a configuration option to produce metrics without a [target info](../../compatibility/prometheus_and_openmetrics.md#resource-attributes-1)
metric. The option MAY be named `without_target_info`, and MUST be `false` by default.

0 comments on commit 88e1639

Please sign in to comment.