2023-07-28 10:35:28 +00:00
|
|
|
#!/bin/bash
|
2024-01-18 10:02:06 +00:00
|
|
|
set -xe
|
2023-07-28 10:35:28 +00:00
|
|
|
|
2023-11-15 14:09:15 +00:00
|
|
|
OTEL_VERSION=v0.88.0
|
2023-07-28 10:35:28 +00:00
|
|
|
|
|
|
|
git clone https://github.com/open-telemetry/opentelemetry-collector-contrib ./tmp
|
|
|
|
cd ./tmp
|
|
|
|
git checkout $OTEL_VERSION
|
|
|
|
cd ..
|
2024-01-18 10:02:06 +00:00
|
|
|
|
2023-07-28 10:35:28 +00:00
|
|
|
rm -rf ./prometheusremotewrite/*
|
|
|
|
cp -r ./tmp/pkg/translator/prometheusremotewrite/*.go ./prometheusremotewrite
|
2024-01-18 10:02:06 +00:00
|
|
|
rm -rf ./prometheusremotewrite/*_test.go
|
|
|
|
|
|
|
|
rm -rf ./prometheus/*
|
2023-11-15 14:09:15 +00:00
|
|
|
cp -r ./tmp/pkg/translator/prometheus/*.go ./prometheus
|
|
|
|
rm -rf ./prometheus/*_test.go
|
2024-01-18 10:02:06 +00:00
|
|
|
|
2023-07-28 10:35:28 +00:00
|
|
|
rm -rf ./tmp
|
|
|
|
|
2024-01-25 13:27:43 +00:00
|
|
|
case $(sed --help 2>&1) in
|
|
|
|
*GNU*) set sed -i;;
|
|
|
|
*) set sed -i '';;
|
|
|
|
esac
|
|
|
|
|
|
|
|
"$@" -e 's#github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus#github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheus#g' ./prometheusremotewrite/*.go
|
|
|
|
"$@" -e '1s#^#// DO NOT EDIT. COPIED AS-IS. SEE ../README.md\n\n#g' ./prometheusremotewrite/*.go ./prometheus/*.go
|