mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2026-01-09 05:12:28 -06:00
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:
@@ -62,6 +62,7 @@ import { ChannelStartupService } from '@api/services/channel.service';
|
||||
import { Events, MessageSubtype, TypeMediaMessage, wa } from '@api/types/wa.types';
|
||||
import { CacheEngine } from '@cache/cacheengine';
|
||||
import {
|
||||
AudioConverter,
|
||||
CacheConf,
|
||||
Chatwoot,
|
||||
ConfigService,
|
||||
@@ -2837,7 +2838,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
}
|
||||
|
||||
public async processAudio(audio: string): Promise<Buffer> {
|
||||
if (process.env.API_AUDIO_CONVERTER) {
|
||||
const audioConverterConfig = this.configService.get<AudioConverter>('AUDIO_CONVERTER');
|
||||
if (audioConverterConfig.API_URL) {
|
||||
this.logger.verbose('Using audio converter API');
|
||||
const formData = new FormData();
|
||||
|
||||
@@ -2847,8 +2849,8 @@ export class BaileysStartupService extends ChannelStartupService {
|
||||
formData.append('base64', audio);
|
||||
}
|
||||
|
||||
const { data } = await axios.post(process.env.API_AUDIO_CONVERTER, formData, {
|
||||
headers: { ...formData.getHeaders(), apikey: process.env.API_AUDIO_CONVERTER_KEY },
|
||||
const { data } = await axios.post(audioConverterConfig.API_URL, formData, {
|
||||
headers: { ...formData.getHeaders(), apikey: audioConverterConfig.API_KEY },
|
||||
});
|
||||
|
||||
if (!data.audio) {
|
||||
|
||||
Reference in New Issue
Block a user