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

Unable to use with @opentelemetry/exporter-prometheus #59

Open
bneigher opened this issue Jan 14, 2023 · 3 comments
Open

Unable to use with @opentelemetry/exporter-prometheus #59

bneigher opened this issue Jan 14, 2023 · 3 comments

Comments

@bneigher
Copy link

Probably a version mismatch (@opentelemetry/exporter-prometheus has been updated pretty recently).

"@metinseylan/nestjs-opentelemetry": "^3.0.0"
"@opentelemetry/exporter-prometheus": "^0.35.0"

But here is there error I am getting:

OpenTelemetryModule.forRoot({
  serviceName: process.env.POD_NAMESPACE,
  metricReader: new PrometheusExporter({
    endpoint: 'metrics',
    port: 8080
  }),
  metricInterval: 100
})
Type 'PrometheusExporter' is not assignable to type 'MetricReader'.
Types have separate declarations of a private property '_shutdown'.

Also as a minor sidenote, it looks like the async configuration of this doesn't work for other reasons..

OpenTelemetryModule.forRootAsync({
  imports: [],
  useFactory: async (config: Config) => ({
    applicationName: config.POD_NAMESPACE,
    metricExporter: new PrometheusExporter({
      endpoint: 'metrics',
      port: 8080
    }),
    metricInterval: 100,
  }),
  inject: [Config]
})
Type '(config: Config) => Promise<{ applicationName: string; metricExporter: PrometheusExporter; metricInterval: number; }>' is not assignable to type '(...args: any[]) => Partial<OpenTelemetryModuleConfig> | Promise<Partial<OpenTelemetryModuleConfig>>'.
Type 'Promise<{ applicationName: string; metricExporter: PrometheusExporter; metricInterval: number; }>' is not assignable to type 'Partial<OpenTelemetryModuleConfig> | Promise<Partial<OpenTelemetryModuleConfig>>'.
Type 'Promise<{ applicationName: string; metricExporter: PrometheusExporter; metricInterval: number; }>' is not assignable to type 'Promise<Partial<OpenTelemetryModuleConfig>>'.
@DanielAcostaRoa
Copy link

Have you found any solution for this problem?

@bneigher
Copy link
Author

no, I've decided to use the vanilla sdks because I figured this repo is not being maintained enough for prime time usage

@laurencefass
Copy link

subscribed as I have the same error.

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

3 participants