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'. Type 'SimpleSpanProcessor' is not assignable to type 'SpanProcessor' #63

Open
Krishan27 opened this issue Apr 5, 2023 · 3 comments

Comments

@Krishan27
Copy link

i am facing a type error in the tracing.ts file

import { OpenTelemetryModule } from '@metinseylan/nestjs-opentelemetry';
import { ZipkinExporter } from '@opentelemetry/exporter-zipkin';
import { SimpleSpanProcessor } from '@opentelemetry/sdk-trace-base';

@module({
imports: [
OpenTelemetryModule.forRoot({
spanProcessor: new SimpleSpanProcessor(
new ZipkinExporter({
url: 'your-zipkin-url',
})
),
}),
],
})
export class AppModule {}

@mabotn
Copy link

mabotn commented Apr 27, 2023

@Krishan27 as of now, the only way I figured out to get rid of this is by forcing typescript to ignore the error by adding these two lines

// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
spanProcessor: new SimpleSpanProcessor(
  new OTLPTraceExporter({
    url: 'http://jaeger:4318/v1/traces',
  }),
),

@richysandoval
Copy link

I updated the otel libraries to latest versions and it resolved that issue. Obviously I copied the code to my internal libs to use that versions.

@overbit
Copy link

overbit commented Jun 15, 2023

I've been working on a fork that is using the latest versions and aim to solve this issue plus adding more features, like tracing nestjs microservices providers, a generic wrapper to trace classes not part of the nestjs DI and more.

Have a look if you want https://github.com/amplication/opentelemetry-nestjs

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

No branches or pull requests

4 participants