Opentelemetry-js: exporter-collector-grpc && exporter-collector-proto: missing protos directory in v0.11.0 npm distribution

Created on 16 Sep 2020  路  4Comments  路  Source: open-telemetry/opentelemetry-js

What version of OpenTelemetry are you using?

v0.11.0

What version of Node are you using?

v12.18.3

What did you do?

After upgrade to v0.11.0, I tried to use the grpc exporter, and got the following error in log:

(node:21682) Warning: opentelemetry/proto/collector/trace/v1/trace_service.proto not found in any of the include paths /Users/amirblum/repos/aspecto-opentelemetry-js/node_modules/@opentelemetry/exporter-collector-grpc/build/protos
(node:21682) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open 'opentelemetry/proto/collector/trace/v1/trace_service.proto'

When I checked under the build directory of the npm distribution of @opentelemetry/exporter-collector-grpc, it is missing the protos folder.
I found the following npm script in package.json:
"protos:copy": "cpx protos/opentelemetry/**/*.* build/protos/opentelemetry". When building the project locally on my machine it does copy the protos folder to build directory, but they are not published to npm.
I think it's because they should be added under the "files" section in package.json:

  "files": [
    "build/src/**/*.js",
    "build/src/**/*.js.map",
    "build/src/**/*.d.ts",
    "build/src/**/*.proto",
    "doc",
    "LICENSE",
    "README.md"
  ],

If I copy the directory to my app node_modules under @opentelemetry/exporter-collector-grpc, everything works as expected

bug

Most helpful comment

Can this be closed now?

All 4 comments

@blumamir Do you want to work on fixing this ?

@vmarchaud Yes I'll create a PR soon

@blumamir it will be the same I have updated the title it is the same for proto

Can this be closed now?

Was this page helpful?
0 / 5 - 0 ratings