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

Type 'SimpleSpanProcessor' is not assignable to type 'SpanProcessor' #47

Closed
TroyDavidson opened this issue Sep 19, 2022 · 9 comments
Closed

Comments

@TroyDavidson
Copy link

I'm getting the following error. I'm using the sample code from the README. I believe it's version dependency conflicts.

Type 'SimpleSpanProcessor' is not assignable to type 'SpanProcessor'.
  Types of property 'onStart' are incompatible.
    Type '(_span: Span, _parentContext: Context) => void' is not assignable to type '(span: Span, parentContext: Context) => void'.
      Types of parameters '_span' and 'span' are incompatible.
        Property '_clock' is missing in type 'import("/<snip>/node_modules/@opentelemetry/sdk-trace-node/node_modules/@opentelemetry/sdk-trace-base/build/src/Span").Span' but required in type 'import("/<snip>r/node_modules/@opentelemetry/sdk-trace-base/build/src/Span").Span'.ts(2322)

Span.d.ts(29, 22): '_clock' is declared here.

This is the example code I'm using:

    OpenTelemetryModule.forRoot({
      spanProcessor: new SimpleSpanProcessor(
        new ZipkinExporter({
          url: 'your-zipkin-url',
        })
      ),
    }),
@izevg
Copy link

izevg commented Oct 2, 2022

Confirming.

Temporary solution: rollback/lock the @opentelemetry/sdk-trace-base version on 1.0.1, as per this lib package-lock.json
Proper way: update all the used @opentelemetry/* packages to the actual versions & fix the issues. (FYI: sdk-trace-base is on v1.7.0 already, and contains A LOT of breaking changes in between versions)

@MetinSeylan could you please be so kind? 🙏🏻

@MetinSeylan
Copy link
Owner

Hey 🖖 fixed with new version, but keep in mind new version required nestjs 9

@codeprefect
Copy link

Hi @MetinSeylan,

This issue persists even on nestjs v9.
As a stop-gap for my work, I forked this repo, and updated all the dependencies, which appears to fix it for my case.
I currently have the package installed with

"dependencies": {
  ...
  @metinseylan/nestjs-opentelemetry": "https://github.com/codeprefect/Nestjs-OpenTelemetry#head=update-otel-deps",
  ...
}

Happy to rollback once we have it fixed here.

@murar8
Copy link

murar8 commented Dec 27, 2022

I can confirm the issue persists for me too.

@slaaavyn
Copy link

The problem is actual, please approve PR #58

@amitzig
Copy link

amitzig commented Jan 22, 2023

Any update on this?

@valanto
Copy link

valanto commented Feb 17, 2023

@MetinSeylan Any update on this? The issue persists on NestJS 9. Thanks!

@slaaavyn
Copy link

Solved my problems by using opentelemetry without this library.
As an example I use https://github.com/polyflix/video/blob/5d81560edca81e2d49a406b3a62b130f6839baf3/src/main/config/tracing.config.ts

@murar8
Copy link

murar8 commented Mar 17, 2023

For anyone still having this issue a temporary solution is to lock the peer dependencies in your package.json to the same version as the library (notice the missing ^)

  "dependencies": {
    "@metinseylan/nestjs-opentelemetry": "^3.0.0",
    "@opentelemetry/sdk-trace-base": "1.9.1"
  },

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants