feat(config): add telemetry and metrics configuration options

- Introduce new environment variables for telemetry and Prometheus metrics in .env.example
- Create example configuration files for Prometheus and Grafana dashboards
- Update main application to utilize new configuration settings for Sentry, audio converter, and proxy
- Enhance channel services to support audio conversion API integration
- Implement middleware for metrics IP whitelisting and basic authentication in routes
This commit is contained in:
Davidson Gomes
2025-09-17 16:50:36 -03:00
parent 81a991a62e
commit 3ddbd6a7fb
16 changed files with 538 additions and 44 deletions

View File

@@ -6,7 +6,15 @@ import { ProviderFiles } from '@api/provider/sessions';
import { PrismaRepository } from '@api/repository/repository.service';
import { HttpStatus, router } from '@api/routes/index.router';
import { eventManager, waMonitor } from '@api/server.module';
import { Auth, configService, Cors, HttpServer, ProviderSession, Webhook } from '@config/env.config';
import {
Auth,
configService,
Cors,
HttpServer,
ProviderSession,
Sentry as SentryConfig,
Webhook,
} from '@config/env.config';
import { onUnexpectedError } from '@config/error.config';
import { Logger } from '@config/logger.config';
import { ROOT_DIR } from '@config/path.config';
@@ -140,7 +148,8 @@ async function bootstrap() {
eventManager.init(server);
if (process.env.SENTRY_DSN) {
const sentryConfig = configService.get<SentryConfig>('SENTRY');
if (sentryConfig.DSN) {
logger.info('Sentry - ON');
// Add this after all routes,