diff --git a/storage/remote/otlptranslator/prometheus/normalize_label.go b/storage/remote/otlptranslator/prometheus/normalize_label.go index b44ba869fe..c02800c8bc 100644 --- a/storage/remote/otlptranslator/prometheus/normalize_label.go +++ b/storage/remote/otlptranslator/prometheus/normalize_label.go @@ -1,3 +1,5 @@ +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 @@ -25,6 +27,7 @@ var dropSanitizationGate = featuregate.GlobalRegistry().MustRegister( // // Exception is made for double-underscores which are allowed func NormalizeLabel(label string) string { + // Trivial case if len(label) == 0 { return label diff --git a/storage/remote/otlptranslator/prometheus/normalize_name.go b/storage/remote/otlptranslator/prometheus/normalize_name.go index 72fc04cea2..7ae233a187 100644 --- a/storage/remote/otlptranslator/prometheus/normalize_name.go +++ b/storage/remote/otlptranslator/prometheus/normalize_name.go @@ -1,3 +1,5 @@ +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/prometheus/unit_to_ucum.go b/storage/remote/otlptranslator/prometheus/unit_to_ucum.go index b2f2c4f3aa..4a72e683bb 100644 --- a/storage/remote/otlptranslator/prometheus/unit_to_ucum.go +++ b/storage/remote/otlptranslator/prometheus/unit_to_ucum.go @@ -1,3 +1,5 @@ +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md + // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/prometheusremotewrite/helper.go b/storage/remote/otlptranslator/prometheusremotewrite/helper.go index 49ad5672b3..09b39d29d9 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/helper.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/helper.go @@ -1,4 +1,4 @@ -// DO NOT EDIT. COPIED AS-IS. SEE README.md +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/prometheusremotewrite/histograms.go b/storage/remote/otlptranslator/prometheusremotewrite/histograms.go index 3c7494a6bf..0a528f6074 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/histograms.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/histograms.go @@ -1,4 +1,4 @@ -// DO NOT EDIT. COPIED AS-IS. SEE README.md +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go b/storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go index 6a5a656048..6e8f42fae0 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/metrics_to_prw.go @@ -1,4 +1,4 @@ -// DO NOT EDIT. COPIED AS-IS. SEE README.md +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go b/storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go index c8e59694b8..85684ad6de 100644 --- a/storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go +++ b/storage/remote/otlptranslator/prometheusremotewrite/number_data_points.go @@ -1,4 +1,4 @@ -// DO NOT EDIT. COPIED AS-IS. SEE README.md +// DO NOT EDIT. COPIED AS-IS. SEE ../README.md // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 diff --git a/storage/remote/otlptranslator/update-copy.sh b/storage/remote/otlptranslator/update-copy.sh index 36ad0cc35c..44b3a3245c 100755 --- a/storage/remote/otlptranslator/update-copy.sh +++ b/storage/remote/otlptranslator/update-copy.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -xe OTEL_VERSION=v0.88.0 @@ -6,11 +7,16 @@ git clone https://github.com/open-telemetry/opentelemetry-collector-contrib ./tm cd ./tmp git checkout $OTEL_VERSION cd .. + rm -rf ./prometheusremotewrite/* cp -r ./tmp/pkg/translator/prometheusremotewrite/*.go ./prometheusremotewrite +rm -rf ./prometheusremotewrite/*_test.go + +rm -rf ./prometheus/* cp -r ./tmp/pkg/translator/prometheus/*.go ./prometheus rm -rf ./prometheus/*_test.go + rm -rf ./tmp sed -i '' 's#github.com/open-telemetry/opentelemetry-collector-contrib/pkg/translator/prometheus#github.com/prometheus/prometheus/storage/remote/otlptranslator/prometheus#g' ./prometheusremotewrite/*.go -sed -i '' '1s#^#// DO NOT EDIT. COPIED AS-IS. SEE README.md\n\n#g' ./prometheusremotewrite/*.go +sed -i '' '1s#^#// DO NOT EDIT. COPIED AS-IS. SEE ../README.md\n\n#g' ./prometheusremotewrite/*.go ./prometheus/*.go