librdkafka icon indicating copy to clipboard operation
librdkafka copied to clipboard

src/opentelemetry only includes compiled code - no source is provided

Open paravoid opened this issue 3 months ago • 2 comments

src/opentelemetry does not include the preferred source of modification, i.e. the .proto file, but rather just the nanopb-generated compiled source (.pb.c/.pb.h). TTBOMK https://github.com/open-telemetry/opentelemetry-proto is the canonical source; I tried to find the specific commit this was generated from and failed. All the differences seem to be in metrics.pb.h - the rest of the files generate identical code.

While not technically a license violation (Apache 2.0 is not copyleft and does not require you to ship the source), it's poor hygiene to include compiled output and not its respective source, as it makes it harder to track authorship, validate the chain of trust, update this in the future, etc.

Please:

  1. Include the source .proto file to accompany the binary .pb.c/.pb.h.
  2. Include the necessary plumbing (e.g. Makefile) to regenerate the headers/C code from the proto file, using the nanopb compiler, so that it makes it easier to regenerate this when those files get updated.

paravoid avatar Sep 03 '25 14:09 paravoid

As far as I can tell, it's something like...

apt install nanopb opentelemetry-proto

nanopb_generator.py \
        --output-dir=src/opentelemetry/ \
        --options-file=src/opentelemetry/metrics.options \
        -L "#include <nanopb/%s>" \
        -I/usr/include \
        /usr/include/opentelemetry/proto/common/v1/common.proto \
        /usr/include/opentelemetry/proto/resource/v1/resource.proto \
        /usr/include/opentelemetry/proto/metrics/v1/metrics.proto 

...and then mangle the include hierarchy and #include paths by hand?

paravoid avatar Sep 03 '25 16:09 paravoid

Yeah, aware of it, it was accepted as technical debt when reviewing KIP-714.

emasab avatar Sep 06 '25 15:09 emasab