Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(otel): update to new otlp version #3796

Merged
merged 12 commits into from
Dec 31, 2024
16 changes: 8 additions & 8 deletions api/otlp/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ endef
OPENTELEMETRY_PROTO_SRC_DIR=.tmp/opentelemetry-proto

# The SHA matching the current version of the proto to use
OPENTELEMETRY_PROTO_VERSION=v1.3.2
OPENTELEMETRY_PROTO_VERSION=v1.5.0

# Find all .proto files.

OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1experimental/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1experimental/*.proto))
OPENTELEMETRY_PROTO_FILES := $(subst $(OPENTELEMETRY_PROTO_SRC_DIR)/,,$(wildcard $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/*/v1development/*.proto $(OPENTELEMETRY_PROTO_SRC_DIR)/opentelemetry/proto/collector/*/v1development/*.proto))

# Target directory to write generated files to.
# PROTO_TARGET_GEN_DIR=otlp
Expand All @@ -35,7 +35,7 @@ PROTO_PACKAGE=github.com/grafana/pyroscope/$(PROTO_TARGET_GEN_DIR)
# Intermediate directory used during generation.
PROTO_INTERMEDIATE_DIR=.tmp/patched-otlp-proto

DOCKER_PROTOBUF ?= otel/build-protobuf:0.9.0
DOCKER_PROTOBUF ?= otel/build-protobuf:0.23.0
PROTOC := docker run --rm -u ${shell id -u} -v${PWD}:${PWD} -w${PWD}/$(PROTO_INTERMEDIATE_DIR) ${DOCKER_PROTOBUF} --proto_path=${PWD}
PROTO_INCLUDES := -I/usr/include/github.com/gogo/protobuf -I./

Expand All @@ -46,10 +46,10 @@ genproto-cleanup:
# Generate OTLP Protobuf Go files. This will place generated files in PROTO_TARGET_GEN_DIR.
genproto: genproto-cleanup
# TODO(@petethepig): undo this
# mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR}
# curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR}
mkdir -p ${OPENTELEMETRY_PROTO_SRC_DIR}
curl -sSL https://api.github.com/repos/open-telemetry/opentelemetry-proto/tarball/${OPENTELEMETRY_PROTO_VERSION} | tar xz --strip 1 -C ${OPENTELEMETRY_PROTO_SRC_DIR}
# # Call a sub-make to ensure OPENTELEMETRY_PROTO_FILES is populated
rsync -av ../../otel/opentelemetry-proto/ ${OPENTELEMETRY_PROTO_SRC_DIR}
#rsync -av ../../otel/opentelemetry-proto/ ${OPENTELEMETRY_PROTO_SRC_DIR}
$(MAKE) genproto_sub
$(MAKE) genproto-cleanup

Expand All @@ -66,13 +66,13 @@ genproto_sub:

# # Patch proto files. See proto_patch.sed for patching rules.
# @echo Modify them in the intermediate directory.
$(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,sed -f api/otlp/proto_patch.sed $(OPENTELEMETRY_PROTO_SRC_DIR)/$(file) > $(PROTO_INTERMEDIATE_DIR)/$(file)))
$(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,sed -f /home/korniltsev/pyroscope/api/otlp/proto_patch.sed $(OPENTELEMETRY_PROTO_SRC_DIR)/$(file) > $(PROTO_INTERMEDIATE_DIR)/$(file)))
korniltsev marked this conversation as resolved.
Show resolved Hide resolved

# HACK: Workaround for istio 1.15 / envoy 1.23.1 mistakenly emitting deprecated field.
# reserved 1000 -> repeated ScopeLogs deprecated_scope_logs = 1000;
sed 's/reserved 1000;/repeated ScopeLogs deprecated_scope_logs = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/logs/v1/logs.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/logs/v1/logs.proto
# reserved 1000 -> repeated ScopeProfiles deprecated_scope_profiles = 1000;
sed 's/reserved 1000;/repeated ScopeProfiles deprecated_scope_profiles = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1experimental/profiles.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1experimental/profiles.proto
sed 's/reserved 1000;/repeated ScopeProfiles deprecated_scope_profiles = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1development/profiles.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/profiles/v1development/profiles.proto
# reserved 1000 -> repeated ScopeMetrics deprecated_scope_metrics = 1000;
sed 's/reserved 1000;/repeated ScopeMetrics deprecated_scope_metrics = 1000;/g' $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/metrics/v1/metrics.proto 1<> $(PROTO_INTERMEDIATE_DIR)/opentelemetry/proto/metrics/v1/metrics.proto
# reserved 1000 -> repeated ScopeSpans deprecated_scope_spans = 1000;
Expand Down

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

Loading
Loading