Skip to content

Conversation

aknuds1
Copy link
Contributor

@aknuds1 aknuds1 commented Jun 20, 2025

For consistent terminology, as it's a similar operation to promoting OTel resource attributes to metric labels, rename the otlp.convert_scope_metadata configuration parameter to otlp.promote_scope_metadata. Thanks to @colega for pointing out them being similar.

Follow-up to #16730.

@aknuds1 aknuds1 requested a review from Copilot June 20, 2025 12:24
@aknuds1 aknuds1 force-pushed the arve/promote-otel-scope branch from 16ef573 to 0ed3da0 Compare June 20, 2025 12:25
@aknuds1 aknuds1 marked this pull request as ready for review June 20, 2025 12:25
@aknuds1 aknuds1 removed request for tomwilkie and cstyan June 20, 2025 12:25
Copilot

This comment was marked as outdated.

@aknuds1 aknuds1 force-pushed the arve/promote-otel-scope branch from 0ed3da0 to 56e37c8 Compare June 20, 2025 12:27
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 force-pushed the arve/promote-otel-scope branch from 56e37c8 to 7e1e6c1 Compare June 20, 2025 12:28
@aknuds1 aknuds1 requested a review from Copilot June 20, 2025 12:31
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR renames the configuration parameter from otlp.convert_scope_metadata to otlp.promote_scope_metadata for improved terminology consistency in the OTLP receiver. The changes update the field names in configuration, code, tests, and documentation to reflect the new naming convention.

  • Updated the configuration struct and related documentation.
  • Modified tests and helper functions to use PromoteScopeMetadata.
  • Updated changelog and accompanying configuration test files.

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
storage/remote/write_handler.go Updated field name from ConvertScopeMetadata to PromoteScopeMetadata in metric consumption.
storage/remote/otlptranslator/prometheusremotewrite/number_data_points_test.go Renamed test variable from convertScope to promoteScope.
storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go Updated configuration field and comment to use PromoteScopeMetadata.
storage/remote/otlptranslator/prometheusremotewrite/histograms_test.go Updated test cases to use promoteScope instead of convertScope.
storage/remote/otlptranslator/prometheusremotewrite/helper_test.go Updated assertions to reflect the new naming.
storage/remote/otlptranslator/prometheusremotewrite/helper.go Updated settings usage to reference PromoteScopeMetadata.
docs/configuration/configuration.md Updated configuration parameter name and description.
config/testdata/*.yml Updated test config files to reflect PromoteScopeMetadata.
config/config_test.go Updated test function and assertions for PromoteScopeMetadata.
config/config.go Updated struct field and comment to use promote_scope_metadata.
CHANGELOG.md Updated changelog entry for the renamed configuration parameter.
Comments suppressed due to low confidence (1)

storage/remote/otlptranslator/prometheusremotewrite/helper.go:127

  • [nitpick] Consider renaming the local variable 'convertScope' to 'promoteScope' for improved clarity and consistency with the new configuration field name.
	convertScope := settings.PromoteScopeMetadata && scope.name != ""

Copy link
Member

@jesusvazquez jesusvazquez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

aknuds1 and others added 2 commits June 20, 2025 14:49
Co-authored-by: Julius Hinze <juliusmh@proton.me>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
@aknuds1 aknuds1 enabled auto-merge (squash) June 20, 2025 13:06
@aknuds1 aknuds1 merged commit c701636 into prometheus:main Jun 20, 2025
27 checks passed
@aknuds1 aknuds1 deleted the arve/promote-otel-scope branch June 20, 2025 13:10
charleskorn pushed a commit to charleskorn/prometheus that referenced this pull request Jun 24, 2025
* fix: prevent invalid array access in aggregate expression

This commit fixes the evaluation of invalid expressions like
`sum(rate(`. Before that, it would trigger a panic in the PromQL engine
because it tried to access an index which is out of range.

The bug was probably introduced by 06d0b06.

Signed-off-by: Simon Pasquier <spasquie@redhat.com>

* OTLP receiver: Rename `otlp.convert_scope_metadata` to `otlp.promote_scope_metadata` (prometheus#16760)

* Rename otlp.convert_scope_metadata to otlp.promote_scope_metadata

---------

Signed-off-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Co-authored-by: Julien <291750+roidelapluie@users.noreply.github.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Julius Hinze <juliusmh@proton.me>
bboreham pushed a commit that referenced this pull request Jul 8, 2025
Reverts #16730 and #16760

This is being done because we've noticed a problem in the spec that could
lead to name collisions if attributes name, version or schema_url are added
to the scope. They would collide with the already reserved labels
otel_scope_name, otel_scope_version and otel_scope_schema_url.

Since this new configuration option never made it into a release, we can
safely remove it from the 3.5 release. We'll sort this out for the 3.6 release

Signed-off-by: Arthur Silva Sens <arthursens2005@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants