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