jaegertracing / jaeger-idl

A set of shared data model definitions used by Jaeger components.
http://jaegertracing.io/
Apache License 2.0
82 stars 74 forks source link

`make proto` leads to *opentelemetry/proto/trace/v1/trace.proto: File not found.* #94

Closed fex01 closed 2 years ago

fex01 commented 2 years ago

Describe the bug Cloning the repo and running make proto in the main directory leads to the following output:

mkdir -p proto-gen-go \
        proto-gen-java \
        proto-gen-python \
        proto-gen-js \
        proto-gen-cpp \
        proto-gen-csharp
docker run --rm -u 1000 -v "/home/fex/repos/jaeger-idl:/home/fex/repos/jaeger-idl" -w /home/fex/repos/jaeger-idl jaegertracing/protobuf:0.3.1 --proto_path=/home/fex/repos/jaeger-idl -Iproto/api_v2 -Iproto -I/usr/include/github.com/gogo/protobuf -Iopentelemetry-proto --gogo_out=plugins=grpc,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,Mmodel.proto=github.com/jaegertracing/jaeger/model:/home/fex/repos/jaeger-idl/proto-gen-go --java_out=proto-gen-java --python_out=proto-gen-python --js_out=proto-gen-js --cpp_out=proto-gen-cpp --csharp_out=base_namespace:proto-gen-csharp \
        proto/api_v2/model.proto
docker run --rm -u 1000 -v "/home/fex/repos/jaeger-idl:/home/fex/repos/jaeger-idl" -w /home/fex/repos/jaeger-idl jaegertracing/protobuf:0.3.1 --proto_path=/home/fex/repos/jaeger-idl -Iproto/api_v2 -Iproto -I/usr/include/github.com/gogo/protobuf -Iopentelemetry-proto --gogo_out=plugins=grpc,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,Mmodel.proto=github.com/jaegertracing/jaeger/model:/home/fex/repos/jaeger-idl/proto-gen-go --java_out=proto-gen-java --python_out=proto-gen-python --js_out=proto-gen-js --cpp_out=proto-gen-cpp --csharp_out=base_namespace:proto-gen-csharp --grpc-java_out=proto-gen-java --grpc-python_out=proto-gen-python --grpc-js_out=proto-gen-js --grpc-cpp_out=proto-gen-cpp --grpc-csharp_out=proto-gen-csharp \
        proto/api_v2/query.proto \
        proto/api_v2/collector.proto \
        proto/api_v2/sampling.proto
# API v3
docker run --rm -u 1000 -v "/home/fex/repos/jaeger-idl:/home/fex/repos/jaeger-idl" -w /home/fex/repos/jaeger-idl jaegertracing/protobuf:0.3.1 --proto_path=/home/fex/repos/jaeger-idl -Iproto/api_v2 -Iproto -I/usr/include/github.com/gogo/protobuf -Iopentelemetry-proto --gogo_out=plugins=grpc,Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/timestamp.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/duration.proto=github.com/gogo/protobuf/types,Mgoogle/protobuf/empty.proto=github.com/gogo/protobuf/types,Mgoogle/api/annotations.proto=github.com/gogo/googleapis/google/api,Mmodel.proto=github.com/jaegertracing/jaeger/model:/home/fex/repos/jaeger-idl/proto-gen-go --java_out=proto-gen-java --python_out=proto-gen-python --js_out=proto-gen-js --cpp_out=proto-gen-cpp --csharp_out=base_namespace:proto-gen-csharp --grpc-java_out=proto-gen-java --grpc-python_out=proto-gen-python --grpc-js_out=proto-gen-js --grpc-cpp_out=proto-gen-cpp --grpc-csharp_out=proto-gen-csharp \
        proto/api_v3/query_service.proto
opentelemetry/proto/trace/v1/trace.proto: File not found.
api_v3/query_service.proto:19:1: Import "opentelemetry/proto/trace/v1/trace.proto" was not found or had errors.
api_v3/query_service.proto:40:12: "opentelemetry.proto.trace.v1.ResourceSpans" is not defined.
make: *** [Makefile:100: proto] Error 1

(most relevant are probably the last 4 lines: opentelemetry/proto/trace/v1/trace.proto: File not found. api_v3/query_service.proto:19:1: Import "opentelemetry/proto/trace/v1/trace.proto" was not found or had errors. api_v3/query_service.proto:40:12: "opentelemetry.proto.trace.v1.ResourceSpans" is not defined. make: *\ [Makefile: 100: proto] Error 1

Nonetheless I copied the resulting files in jaeger-idl/proto-gen-python into my Python project directory and imported the query-files with import query_pb2, query_pb2_grpc - to then run into ModuleNotFoundError: No module named 'gogoproto'

So - is this a bug or am I holding it wrong? And on a side note - does anyone know a working example querying Jaeger via Python? Preferred via gRPC?

yurishkuro commented 2 years ago

did you init git submodule?

fex01 commented 2 years ago

did you init git submodule?

That actually fixed to problem. Would be great to add a remark in that direction to the README - just in case 😅