Skip to content

Commit a93d12c

Browse files
tigrannajaryanwyTrivail
authored andcommitted
Update OTLP to v0.4.0 [Breaking change] (open-telemetry#1142)
This is a breaking OTLP change. - Use AnyValue introduced in recent change to OTLP. Changes are encapsulated in AttributeValue and most of the codebase is unaffected, which proves the wrappers are very useful. - Rename AttributeKeyValue to KeyValue (the change comes from OTLP). - Use local protoc to compile ProtoBufs. Previously used znly/protoc docker image is outdated and results in incorrect code for gRPC-Gateway. TODO: - Need to add support for ARRAY value type. This is not urgent since there are no known data sources that use the ARRAY type yet. - Use Gogoproto `(gogoproto.nullable) = false` annotation for AnyValue to possibly improve performance further.
1 parent 38cb951 commit a93d12c

File tree

27 files changed

+5086
-2746
lines changed

27 files changed

+5086
-2746
lines changed

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,15 @@ genproto_sub:
253253
$(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,sed 's+github.com/open-telemetry/opentelemetry-proto/gen/go/+go.opentelemetry.io/collector/internal/data/opentelemetry-proto-gen/+g' $(OPENTELEMETRY_PROTO_SRC_DIR)/$(file) > $(PROTO_INTERMEDIATE_DIR)/$(file)))
254254

255255
@echo Generate Go code from Logs .proto files in intermediate directory.
256-
$(foreach file,$(LOGS_PROTO_FILES),$(call exec-command,docker run --rm -v $(PWD)/$(LOGS_PROTO_SRC_DIR):$(PWD)/$(LOGS_PROTO_SRC_DIR) -v $(PWD)/$(PROTO_INTERMEDIATE_DIR):$(PWD)/$(PROTO_INTERMEDIATE_DIR) -w $(PWD)/$(LOGS_PROTO_SRC_DIR) znly/protoc --gogofaster_out=plugins=grpc:./ -I./ -I$(PWD)/$(PROTO_INTERMEDIATE_DIR) $(file)))
256+
$(foreach file,$(LOGS_PROTO_FILES),$(call exec-command,cd $(LOGS_PROTO_SRC_DIR) && protoc --gogofaster_out=plugins=grpc:./ -I./ -I$(PWD)/$(PROTO_INTERMEDIATE_DIR) $(file)))
257257

258258
@echo Move generated code to target directory.
259259
mkdir -p $(PROTO_TARGET_GEN_DIR)
260260
cp -R $(LOGS_PROTO_SRC_DIR)/$(PROTO_PACKAGE)/* $(PROTO_TARGET_GEN_DIR)/
261261
rm -rf $(LOGS_PROTO_SRC_DIR)/go.opentelemetry.io
262262

263263
@echo Generate Go code from .proto files in intermediate directory.
264-
$(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,docker run --rm -v $(PWD)/$(PROTO_INTERMEDIATE_DIR):$(PWD)/$(PROTO_INTERMEDIATE_DIR) -w $(PWD)/$(PROTO_INTERMEDIATE_DIR) znly/protoc --gogofaster_out=plugins=grpc:./ -I./ $(file)))
264+
$(foreach file,$(OPENTELEMETRY_PROTO_FILES),$(call exec-command,cd $(PROTO_INTERMEDIATE_DIR) && protoc --gogofaster_out=plugins=grpc:./ -I./ $(file)))
265265

266266
@echo Generate gRPC gateway code.
267267
cd $(PROTO_INTERMEDIATE_DIR) && protoc --grpc-gateway_out=logtostderr=true,grpc_api_configuration=opentelemetry/proto/collector/trace/v1/trace_service_http.yaml:./ opentelemetry/proto/collector/trace/v1/trace_service.proto

cmd/pdatagen/internal/metrics_structs.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ var metricDescriptor = &messageStruct{
152152
originFieldName: "Type",
153153
returnType: "MetricType",
154154
rawType: "otlpmetrics.MetricDescriptor_Type",
155-
defaultVal: "MetricTypeUnspecified",
156-
testVal: "MetricTypeGaugeInt64",
155+
defaultVal: "MetricTypeInvalid",
156+
testVal: "MetricTypeInt64",
157157
},
158158
},
159159
}

0 commit comments

Comments
 (0)