Skip to content

Commit

Permalink
removed unused otel
Browse files Browse the repository at this point in the history
  • Loading branch information
gianlazz committed May 26, 2024
1 parent ea26263 commit d28dbf4
Show file tree
Hide file tree
Showing 7 changed files with 12,409 additions and 17,443 deletions.
29,755 changes: 12,409 additions & 17,346 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 0 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@
"@nestjs/schedule": "^3.0.0",
"@nestjs/serve-static": "^4.0.0",
"@ntegral/nestjs-sentry": "^4.0.0",
"@opentelemetry/auto-instrumentations-node": "^0.34.0",
"@opentelemetry/exporter-jaeger": "^1.7.0",
"@opentelemetry/exporter-prometheus": "^0.33.0",
"@opentelemetry/exporter-trace-otlp-http": "^0.33.0",
"@opentelemetry/resources": "^1.7.0",
"@opentelemetry/sdk-node": "^0.33.0",
"@opentelemetry/semantic-conventions": "^1.7.0",
"@sentry/node": "^7.55.2",
"@sentry/tracing": "^7.55.2",
"adorable-avatars": "^0.5.0",
Expand All @@ -96,7 +89,6 @@
"joi": "^17.9.2",
"jpeg-js": "^0.4.4",
"lodash": "^4.17.21",
"nestjs-otel": "^4.1.0",
"nestjs-pino": "^3.3.0",
"nestjs-s3": "^1.0.1",
"node-datetime": "^2.1.2",
Expand Down
22 changes: 0 additions & 22 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { GraphQLModule } from '@nestjs/graphql';
import { GraphqlInterceptor, SentryModule } from '@ntegral/nestjs-sentry';
import { SeverityLevel } from '@sentry/node';
import * as Joi from 'joi';
import { OpenTelemetryModule } from 'nestjs-otel';
import { S3Module, S3ModuleOptions } from 'nestjs-s3';
import * as path from 'path';
import { AppController } from './app.controller';
Expand All @@ -20,23 +19,13 @@ import { EventModule } from './event/event.module';
import { FileModule } from './file/file.module';
import { HealthModule } from './health/health.module';
import { HubModule } from './hub/hub.module';
import { LoggerModule } from './logger/logger.module';
import { ModerationModule } from './moderation/moderation.module';
import { NotificationModule } from './notification/notification.module';
import { OpenGraphModule } from './open-graph/open-graph.module';
import otelSDK from './tracing';
import { UserModule } from './user/user.module';

@Module({
imports: [
OpenTelemetryModule.forRoot({
metrics: {
hostMetrics: true, // Includes Host Metrics
apiMetrics: {
enable: true, // Includes api metrics
},
},
}),
SentryModule.forRootAsync({
imports: [ConfigModule],
useFactory: async (configService: ConfigService) => ({
Expand Down Expand Up @@ -278,7 +267,6 @@ import { UserModule } from './user/user.module';
ModerationModule,
EventModule,
DataloadersModule,
LoggerModule,
OpenGraphModule,
],
providers: [
Expand All @@ -298,14 +286,4 @@ export class AppModule implements OnModuleInit {
async onModuleInit(): Promise<void> {
await this.orm.getMigrator().up();
}

onApplicationShutdown(signal: string) {
otelSDK
.shutdown()
.then(
() => console.log('SDK shut down successfully'),
err => console.log('Error shutting down SDK', err)
)
.finally(() => process.exit(0));
}
}
17 changes: 0 additions & 17 deletions src/logger/logger.module.ts

This file was deleted.

20 changes: 0 additions & 20 deletions src/logger/logger.ts

This file was deleted.

6 changes: 0 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import otelSDK from './tracing';
import { NestFactory } from '@nestjs/core';
import {
ExpressAdapter,
Expand All @@ -15,11 +14,6 @@ import graphqlUploadExpress from 'graphql-upload/graphqlUploadExpress.js';
import { createProxyMiddleware } from 'http-proxy-middleware';

async function bootstrap() {
// Start SDK before nestjs factory create
await otelSDK.start()
.then(() => console.log('Tracing initialized'))
.catch((error) => console.log('Error initializing tracing', error));

const instance = express();
instance.use('/avatars', require('adorable-avatars/dist/index'));
const logLevels: LogLevel[] = process.env.NODE_ENV === 'development'
Expand Down
24 changes: 0 additions & 24 deletions src/tracing.ts

This file was deleted.

0 comments on commit d28dbf4

Please sign in to comment.