Skip to content

Commit

Permalink
Vendor github.com/prometheus/prometheus dependency to avoid conflicts…
Browse files Browse the repository at this point in the history
… with Otel collector deps in elastic agent.

[git-generate]

module=github.com/prometheus/prometheus
version=v0.54.1
go_import_path=${module}@${version}
go_mod_path=https://raw.githubusercontent.com/prometheus/prometheus/refs/tags/${version}/go.mod

go get ${go_import_path}

go mod vendor

mkdir -p _vendor/${go_import_path}
cp -R vendor/${module}/ _vendor/${go_import_path}
curl ${go_mod_path} -o _vendor/${go_import_path}/go.mod

pushd _vendor/${go_import_path}

go mod tidy

popd

rm -r vendor

go mod edit -droprequire=${module}
go mod edit -require=${module}/v2@v2.54.1
go mod edit -replace=${module}/v2=./_vendor/${go_import_path}

grep -Rl --include="*.go" ${module} | xargs sed -i "" "s|${module}|${module}/v2|g"

go mod tidy
  • Loading branch information
tommyers-elastic committed Mar 4, 2025
1 parent c0fdd97 commit fac1123
Show file tree
Hide file tree
Showing 52 changed files with 22,674 additions and 18 deletions.
201 changes: 201 additions & 0 deletions _vendor/github.com/prometheus/prometheus@v0.54.1/LICENSE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 108 additions & 0 deletions _vendor/github.com/prometheus/prometheus@v0.54.1/NOTICE

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions _vendor/github.com/prometheus/prometheus@v0.54.1/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit fac1123

Please sign in to comment.