You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parse scope information from otel_scope_name, otel_scope_version, and otel_scope_info (#25898)
**Description:**
Implements this specification:
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/compatibility/prometheus_and_openmetrics.md#instrumentation-scope,
with
open-telemetry/opentelemetry-specification#3660
Instrumentation Scope
> Each otel_scope_info metric point present in a batch of metrics SHOULD
be dropped from the incoming scrape, and converted to an instrumentation
scope. The otel_scope_name and otel_scope_version labels, if present,
MUST be converted to the Name and Version of the Instrumentation Scope.
Additional labels MUST be added as scope attributes, with keys and
values unaltered. Other metrics in the batch which have otel_scope_name
and otel_scope_version labels that match an instrumentation scope MUST
be placed within the matching instrumentation scope, and MUST remove
those labels.
> Metrics which are not found to be associated with an instrumentation
scope MUST all be placed within an empty instrumentation scope, and MUST
not have any labels removed.
It does this by:
* For all metrics, use `otel_scope_name` and `otel_scope_version` to set
the scope name and version.
* For `otel_scope_info` metrics, use `otel_scope_name` and
`otel_scope_version` as the scope name and version, and all other labels
(other than `job`/`instance`/`__name__`) as scope attributes.
* Change `map[metricName]metricFamily` to
`map[scope][metricName]metricFamily` to sort metrics by instrumentation
scope as they come in, and to make writing the scope easier on commit.
**Link to tracking Issue:**
Fixes#25870
# Use this changelog template to create an entry for release notes.
2
+
3
+
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
4
+
change_type: enhancement
5
+
6
+
# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
7
+
component: prometheusreceiver
8
+
9
+
# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
10
+
note: The otel_scope_name and otel_scope_version labels are used to populate scope name and version. otel_scope_info is used to populate scope attributes.
11
+
12
+
# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists.
13
+
issues: [25870]
14
+
15
+
# (Optional) One or more lines of additional information to render under the primary note.
16
+
# These lines will be padded with 2 spaces and then inserted directly into the document.
17
+
# Use pipe (|) for multiline entries.
18
+
subtext:
19
+
20
+
# If your change doesn't affect end users or the exported elements of any package,
21
+
# you should instead start your pull request title with [chore] or use the "Skip Changelog" label.
22
+
# Optional: The change log or logs in which this entry should be included.
23
+
# e.g. '[user]' or '[user, api]'
24
+
# Include 'user' if the change is relevant to end users.
25
+
# Include 'api' if there is a change to a library API.
0 commit comments