Minor fixes to otlp vendor update script

Signed-off-by: Goutham <gouthamve@gmail.com>
This commit is contained in:
Goutham 2024-01-18 15:32:06 +05:30
parent d3dfe486fc
commit aee6896c47
No known key found for this signature in database
GPG Key ID: F1C217E8E9023CAD
8 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,5 @@
// DO NOT EDIT. COPIED AS-IS. SEE ../README.md
// Copyright The OpenTelemetry Authors // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0
@ -25,6 +27,7 @@ var dropSanitizationGate = featuregate.GlobalRegistry().MustRegister(
// //
// Exception is made for double-underscores which are allowed // Exception is made for double-underscores which are allowed
func NormalizeLabel(label string) string { func NormalizeLabel(label string) string {
// Trivial case // Trivial case
if len(label) == 0 { if len(label) == 0 {
return label return label

View File

@ -1,3 +1,5 @@
// DO NOT EDIT. COPIED AS-IS. SEE ../README.md
// Copyright The OpenTelemetry Authors // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -1,3 +1,5 @@
// DO NOT EDIT. COPIED AS-IS. SEE ../README.md
// Copyright The OpenTelemetry Authors // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -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 // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -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 // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -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 // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -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 // Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0 // SPDX-License-Identifier: Apache-2.0

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
set -xe
OTEL_VERSION=v0.88.0 OTEL_VERSION=v0.88.0
@ -6,11 +7,16 @@ git clone https://github.com/open-telemetry/opentelemetry-collector-contrib ./tm
cd ./tmp cd ./tmp
git checkout $OTEL_VERSION git checkout $OTEL_VERSION
cd .. cd ..
rm -rf ./prometheusremotewrite/* rm -rf ./prometheusremotewrite/*
cp -r ./tmp/pkg/translator/prometheusremotewrite/*.go ./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 cp -r ./tmp/pkg/translator/prometheus/*.go ./prometheus
rm -rf ./prometheus/*_test.go rm -rf ./prometheus/*_test.go
rm -rf ./tmp 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 '' '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