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

opentelemetry/proto/collector/trace/v1/trace_service.proto File not Found #3632

Closed
vseverestek opened this issue Feb 23, 2023 · 8 comments · Fixed by #3705
Closed

opentelemetry/proto/collector/trace/v1/trace_service.proto File not Found #3632

vseverestek opened this issue Feb 23, 2023 · 8 comments · Fixed by #3705
Assignees
Labels
enhancement New feature or request information-requested Bug is waiting on additional information from the user

Comments

@vseverestek
Copy link

vseverestek commented Feb 23, 2023

What happened?

Steps to Reproduce

Use Rollup to build the project

Expected Result

Runs as expected

Actual Result

opentelemetry/proto/collector/trace/v1/trace_service.proto File not found.

Additional Details

OpenTelemetry Setup Code

// import { AwsLambdaInstrumentation } from '@opentelemetry/instrumentation-aws-lambda';
import {
  diag,
  DiagConsoleLogger,
  DiagLogLevel,
  trace,
} from '@opentelemetry/api';

import {
  BatchSpanProcessor,
  ConsoleSpanExporter,
} from '@opentelemetry/sdk-trace-base';
import { OTLPTraceExporter } from '@opentelemetry/exporter-trace-otlp-grpc';

import { NodeTracerProvider } from '@opentelemetry/sdk-trace-node';
import { registerInstrumentations } from '@opentelemetry/instrumentation';
import { getNodeAutoInstrumentations } from '@opentelemetry/auto-instrumentations-node';
import grpc from '@grpc/grpc-js';
import { Resource } from '@opentelemetry/resources';
import { SemanticResourceAttributes } from '@opentelemetry/semantic-conventions';

diag.setLogger(new DiagConsoleLogger(), DiagLogLevel.INFO);
const apikey = 'API_KEY';
const serviceName = 'test-service';
const provider = new NodeTracerProvider({
  resource: new Resource({
    [SemanticResourceAttributes.SERVICE_NAME]: serviceName,
  }),
});
const metadata = new grpc.Metadata();
metadata.set('x-honeycomb-team', apikey);
metadata.set('x-honeycomb-dataset', 'spr-fi-en-idam');
const creds = grpc.credentials.createSsl();
const collectorOptions = {
  credentials: creds,
  url: 'http://api.honeycomb.io:443/',
  metadata,
};

const exporter = new OTLPTraceExporter(collectorOptions);

const spanProcessor = new BatchSpanProcessor(exporter);

provider.addSpanProcessor(spanProcessor);
console.log('Starting OpenTelemetry');

// // uncomment this to see traces in stdout
// provider.addSpanProcessor(new BatchSpanProcessor(new ConsoleSpanExporter()));

provider.register();
// trace.getTracer(
//     'my-service-tracer'
// );
// const activeSpan = tracer.startActiveSpan(api.context.active());
// console.log('Critical Error', {
//   traceId: activeSpan.spanContext().traceId,
// });
registerInstrumentations({
  instrumentations: [
    getNodeAutoInstrumentations({
      '@opentelemetry/instrumentation-aws-lambda': {
        disableAwsContextPropagation: true,
      },
    }),
  ],
});
// registerInstrumentations({
//   instrumentations: [
//     new AwsLambdaInstrumentation({
//       requestHook: (span, { event, context }) => {
//         span.setAttribute('faas.name', context.functionName);
//       },
//       responseHook: (span, { err, res }) => {
//         if (err instanceof Error) span.setAttribute('faas.error', err.message);
//         if (res) span.setAttribute('faas.res', res);
//       },
//     }),
//   ],
// });
const registerProvider = () => {
  console.log('Started');
};
export default registerProvider;

package.json

  "dependencies": {
    "@babel/core": "^7.14.2",
    "@babel/plugin-transform-runtime": "^7.14.2",
    "@babel/preset-env": "^7.14.2",
    "@babel/runtime": "^7.10.2",
    "@grpc/grpc-js": "^1.8.9",
    "@opentelemetry/api": "^1.4.0",
    "@opentelemetry/auto-instrumentations-node": "^0.31.2",
    "@opentelemetry/exporter-trace-otlp-grpc": "^0.35.1",
    "@opentelemetry/instrumentation": "^0.35.1",
    "@opentelemetry/instrumentation-aws-lambda": "^0.35.0",
    "@opentelemetry/instrumentation-aws-sdk": "^0.34.0",
    "@opentelemetry/instrumentation-http": "^0.35.1",
    "@opentelemetry/resources": "^1.9.1",
    "@opentelemetry/sdk-trace-base": "^1.9.1",
    "@opentelemetry/sdk-trace-node": "^1.9.1",
    "@opentelemetry/semantic-conventions": "^1.9.1",
    "@rollup/plugin-commonjs": "24.0.1",
    "@rollup/plugin-json": "^4.1.0",
    "@rollup/plugin-node-resolve": "^13.0.0",
    "@testing-library/jest-dom": "^5.10.1",
    "@testing-library/react": "^11.2.6",
    "aws-sdk": "^2.906.0",
    "indent-string": "^5.0.0",
    "js-yaml": "^4.1.0",
    "lodash": "^4.17.15",
    "nock": "^13.0.11",
    "rollup": "^2.17.1",
    "rollup-plugin-babel": "^4.3.3",
    "rollup-plugin-gproto": "^1.0.1",
    "rollup-plugin-grpc-proto": "^1.1.0",
    "rollup-plugin-proto": "^1.1.2",
    "rollup-plugin-re": "^1.0.7",
    "rollup-plugin-terser": "^7.0.2"
  },
  "devDependencies": {
    "auto-changelog": "^2.1.0",
    "eslint": "^7.2.0",
    "husky": "^6.0.0",
    "jest": "^26.0.1",
    "jest-haste-map": "^26.0.1",
    "jest-junit": "^12.0.0",
    "jest-resolve": "^26.0.1",
    "prettier": "^2.0.5"
  },
  "scripts": {
    "build:all": "yarn build:lambda:resolvers && yarn build:lambda:registration && yarn"
  }
}

Relevant log output

Starting OpenTelemetry
@opentelemetry/instrumentation-aws-sdk Module aws-sdk has been loaded before @opentelemetry/instrumentation-aws-sdk so it might not work, please initialize it before requiring aws-sdk
Started
(node:25880) NOTE: The AWS SDK for JavaScript (v2) will be put into maintenance mode in 2023.

Please migrate your code to use AWS SDK for JavaScript (v3).
For more information, check the migration guide at https://a.co/7PzMCcy
(Use `node --trace-warnings ...` to show where the warning was created)
(node:25880) Warning: opentelemetry/proto/collector/trace/v1/trace_service.proto not found in any of the include paths C:\Users\Admin\Desktop\Sci-fi\projects\SAM\lambdas\idam-resolvers\protos
{"stack":"Error: ENOENT: no such file or directory, open 'C:\\Users\\Admin\\Desktop\\Sci-fi\\projects\\SAM\\opentelemetry\\proto\\collector\\trace\\v1\\trace_service.proto'","message":"ENOENT: no such file or directory, open 'C:\\Users\\Admin\\Desktop\\Sci-fi\\projects\\SAM\\opentelemetry\\proto\\collector\\trace\\v1\\trace_service.proto'","errno":"-4058","code":"ENOENT","syscall":"open","path":"C:\\Users\\Admin\\Desktop\\Sci-fi\\projects\\SAM\\opentelemetry\\proto\\collector\\trace\\v1\\trace_service.proto","name":"Error"}
@vseverestek vseverestek added bug Something isn't working triage labels Feb 23, 2023
@dyladan
Copy link
Member

dyladan commented Feb 24, 2023

@MSNev I'm not a rollup expert is there some missing config?

@MSNev
Copy link
Contributor

MSNev commented Feb 24, 2023

What version are you upgrading from ?

The grpc trace exporter was updated in v0.3.5 (v1.9.0) to support web and it added @opentelemetry/exporter-trace-otlp-proto as a dependency. This error seems to be caused by either

  • SAM\lambdas\idam-resolvers\protos is expecting the opentelemetry\\proto\\collector\\trace\\v1\\trace_service.proto to exist but it doesn't (in the expected path)
  • @dyladan - Wasn't there some talk about removing the proto files in favor of JS generated code?
  • Just a missing config / expected / new dependency...

There does appear to be a version mismatch
"@opentelemetry/instrumentation-aws-lambda": "^0.35.0",
"@opentelemetry/instrumentation-aws-sdk": "^0.34.0",
"@opentelemetry/instrumentation-http": "^0.35.1",

@viralfineos
Copy link

What version are you upgrading from ?

The grpc trace exporter was updated in v0.3.5 (v1.9.0) to support web and it added @opentelemetry/exporter-trace-otlp-proto as a dependency. This error seems to be caused by either

  • SAM\lambdas\idam-resolvers\protos is expecting the opentelemetry\\proto\\collector\\trace\\v1\\trace_service.proto to exist but it doesn't (in the expected path)
  • @dyladan - Wasn't there some talk about removing the proto files in favor of JS generated code?
  • Just a missing config / expected / new dependency...

There does appear to be a version mismatch "@opentelemetry/instrumentation-aws-lambda": "^0.35.0", "@opentelemetry/instrumentation-aws-sdk": "^0.34.0", "@opentelemetry/instrumentation-http": "^0.35.1",

Using node 16
Not updating any deps just freshly installed them.
I will check on the version mismatch and update you if it works for me.
Thanks for the quick response.

@dyladan
Copy link
Member

dyladan commented Feb 24, 2023

@dyladan - Wasn't there some talk about removing the proto files in favor of JS generated code?

Yes but so far that's only done in the protobuf/http exporter not the gRPC exporter.

@dyladan
Copy link
Member

dyladan commented Mar 1, 2023

Are you running in a browser? or are you using rollup for a node deployment? this exporter is not supported in browser and if you're using rollup you may not be including the .proto files. I'm not a rollup expert but the files are loaded at runtime not compile time so they still need to be available.

@vseverestek
Copy link
Author

Are you running in a browser? or are you using rollup for a node deployment? this exporter is not supported in browser and if you're using rollup you may not be including the .proto files. I'm not a rollup expert but the files are loaded at runtime not compile time so they still need to be available.

Using them for node deployments.
For lambda functions

@pichlermarc
Copy link
Member

This looks very similar to #2786.

AFAIK the gRPC exporter has not been updated yet, only @opentelemetry/exporter-trace-otlp-proto was. Would using @opentelemetry/exporter-trace-otlp-proto be an acceptable workaround until #2786 is implemented? 🤔

@pichlermarc pichlermarc added information-requested Bug is waiting on additional information from the user duplicate labels Mar 8, 2023
@pichlermarc pichlermarc self-assigned this Mar 29, 2023
@pichlermarc
Copy link
Member

I'm changing this to enhancement as we have not supported bundling with the gRPC exporters until now. However, I have a PR for that in the pipleline that should address this problem #3705 🙂

@pichlermarc pichlermarc added enhancement New feature or request and removed bug Something isn't working triage labels Mar 29, 2023
@pichlermarc pichlermarc added this to the OTLP Exporter GA milestone Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request information-requested Bug is waiting on additional information from the user
Projects
None yet
5 participants