Skip to content

Match prometheus version with upstream prometheusreceivers'#45886

Merged
khushijain21 merged 3 commits intoelastic:mainfrom
khushijain21:updateprom
Aug 12, 2025
Merged

Match prometheus version with upstream prometheusreceivers'#45886
khushijain21 merged 3 commits intoelastic:mainfrom
khushijain21:updateprom

Conversation

@khushijain21
Copy link
Contributor

@khushijain21 khushijain21 commented Aug 11, 2025

Proposed commit message

Match the prometheus/prometheus version used by upstream prometheusreceiver to avoid dependency conflict in elastic-agent

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files
  • I have added tests that prove my fix is effective or that my feature works
  • I have added an entry in CHANGELOG.next.asciidoc or CHANGELOG-developer.next.asciidoc.

Why is it required

Description

Currently, prometheusreceiver uses an unreleased version of prometheus/prometheus

	github.com/prometheus/prometheus v0.304.3-0.20250703114031-419d436a447a
	github.com/stretchr/testify v1.10.0

which uses the latest version of oteltranslator ( reverted in the v0.305.0 release prometheus/prometheus@3253ba6 )

This mismatch is causing dependency conflict when updating otel collector dependencies in elastic-agent

Compilation error as follows

> build: Building elastic-agent
# github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheusremotewrite
../pkg/mod/github.com/prometheus/prometheus@v0.305.0/storage/remote/otlptranslator/prometheusremotewrite/helper.go:155:30: undefined: otlptranslator.NormalizeLabel
../pkg/mod/github.com/prometheus/prometheus@v0.305.0/storage/remote/otlptranslator/prometheusremotewrite/helper.go:167:32: undefined: otlptranslator.NormalizeLabel
../pkg/mod/github.com/prometheus/prometheus@v0.305.0/storage/remote/otlptranslator/prometheusremotewrite/helper.go:207:26: undefined: otlptranslator.NormalizeLabel
Error: running "go build -o build/elastic-agent -buildmode pie -trimpath -ldflags -s -X github.com/elastic/elastic-agent/version.buildTime=2025-08-08T15:33:17Z -X github.com/elastic/elastic-agent/version.commit=7e374e8177f915f9c2a9bd806ab43fe0c9f121f7 -X github.com/elastic/elastic-agent/internal/pkg/release.snapshot=" failed with exit code 1

@khushijain21 khushijain21 requested a review from a team as a code owner August 11, 2025 08:18
@botelastic botelastic bot added the needs_team Indicates that the issue/PR needs a Team:* label label Aug 11, 2025
@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@khushijain21 khushijain21 marked this pull request as draft August 11, 2025 08:18
@mergify
Copy link
Contributor

mergify bot commented Aug 11, 2025

This pull request does not have a backport label.
If this is a bug or security fix, could you label this PR @khushijain21? 🙏.
For such, you'll need to label your PR with:

  • The upcoming major version of the Elastic Stack
  • The upcoming minor version of the Elastic Stack (if you're not pushing a breaking change)

To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit
  • backport-active-all is the label that automatically backports to all active branches.
  • backport-active-8 is the label that automatically backports to all active minor branches for the 8 major.
  • backport-active-9 is the label that automatically backports to all active minor branches for the 9 major.

@khushijain21 khushijain21 marked this pull request as ready for review August 11, 2025 09:31
@khushijain21 khushijain21 added the Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team label Aug 11, 2025
@elasticmachine
Copy link
Contributor

Pinging @elastic/elastic-agent-data-plane (Team:Elastic-Agent-Data-Plane)

@botelastic botelastic bot removed the needs_team Indicates that the issue/PR needs a Team:* label label Aug 11, 2025
@khushijain21
Copy link
Contributor Author

/test

@ishleenk17
Copy link
Member

@khushijain21 : Could you share details of this downgrade of the library ?
Was it breaking something ?

@khushijain21
Copy link
Contributor Author

Hello @ishleenk17, I updated the description with more details, can you take a look again?

@khushijain21 khushijain21 enabled auto-merge (squash) August 12, 2025 06:08
@khushijain21 khushijain21 merged commit 2e0b894 into elastic:main Aug 12, 2025
206 checks passed
@khushijain21 khushijain21 added the backport-active-all Automated backport with mergify to all the active branches label Aug 12, 2025
@rdner rdner added backport-active-all Automated backport with mergify to all the active branches and removed backport-active-all Automated backport with mergify to all the active branches labels Aug 12, 2025
@khushijain21 khushijain21 added the backport-8.19 Automated backport to the 8.19 branch label Aug 12, 2025
mergify bot pushed a commit that referenced this pull request Aug 12, 2025
(cherry picked from commit 2e0b894)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
@khushijain21 khushijain21 added the backport-9.1 Automated backport to the 9.1 branch label Aug 13, 2025
mergify bot pushed a commit that referenced this pull request Aug 13, 2025
(cherry picked from commit 2e0b894)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum
khushijain21 added a commit that referenced this pull request Aug 13, 2025
…45954)

(cherry picked from commit 2e0b894)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum

Co-authored-by: Khushi Jain <khushi.jain@elastic.co>
khushijain21 added a commit that referenced this pull request Aug 13, 2025
…heusreceivers' (#45924)

* Match prometheus version with upstream prometheusreceivers' (#45886)

(cherry picked from commit 2e0b894)

# Conflicts:
#	NOTICE.txt
#	go.mod
#	go.sum

* go mod tidy

---------

Co-authored-by: Khushi Jain <khushi.jain@elastic.co>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-8.19 Automated backport to the 8.19 branch backport-9.1 Automated backport to the 9.1 branch backport-active-all Automated backport with mergify to all the active branches Team:Elastic-Agent-Data-Plane Label for the Agent Data Plane team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants