Skip to content
This repository has been archived by the owner on Dec 4, 2020. It is now read-only.

Tricoder not working with Nest.js #98

Open
TautvydasDerzinskas opened this issue Sep 25, 2019 · 0 comments
Open

Tricoder not working with Nest.js #98

TautvydasDerzinskas opened this issue Sep 25, 2019 · 0 comments

Comments

@TautvydasDerzinskas
Copy link

Hello,

I'm trying to use this middleware with Nest.js framework (which normally works with Express middlewares as the core of the framework is Express).

Here is sample of my server instance bootstrap file:
`import { NestFactory } from '@nestjs/core';
import { AppModule } from './app/app.module';

// import * as metrics from 'prometheus-api-metrics';
import * as tricorder from '@trussle/tricorder';
import * as logger from 'express-bunyan-logger';

async function bootstrap() {
const app = await NestFactory.create(AppModule);
// app.use(metrics());
app.use(logger());
tricorder.instrument(app as any);
await app.listen(process.env.PORT || 3000);
}
bootstrap();
There is a type conflict as nestJs server instance has a extended Express type, but this can be dealt like this:tricorder.instrument(app as any);`

Then I'm getting this issue:
Screenshot 2019-09-25 at 10 19 07

Which leads me to user your competitor prometheus-api-metrics ... (good place to check how they handling nest?)

I do prefer tricoder because https_total_requests metrics addition which is very useful.

Nest.js is very quickly growing framework so this should be worth attention.

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

No branches or pull requests

1 participant