fix: adjusts in telemetry

This commit is contained in:
Davidson Gomes 2024-08-08 20:18:20 -03:00
parent 6f2971cf24
commit 83d88ad70a
5 changed files with 27 additions and 12 deletions

View File

@ -1,6 +1,8 @@
SERVER_TYPE=http
SERVER_PORT=8080
SERVER_URL=http://localhost:8080
# TELEMETRY=true
# TELEMETRY_URL=https://log.evolution-api.com/telemetry
CORS_ORIGIN=*
CORS_METHODS=GET,POST,PUT,DELETE

View File

@ -6,6 +6,10 @@
* OwnerJid passed to typebot
* Function for openai assistant added
### Fixed
* Adjusts in telemetry
# 2.0.7-rc (2024-08-03 14:04)
### Fixed

File diff suppressed because one or more lines are too long

View File

@ -5,7 +5,7 @@
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Evolution Manager</title>
<script type="module" crossorigin src="/assets/index-BRWhgzNI.js"></script>
<script type="module" crossorigin src="/assets/index-C__fF5dP.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-DZ0gaAHg.css">
</head>
<body>

View File

@ -10,14 +10,23 @@ export interface TelemetryData {
}
export const sendTelemetry = async (route: string): Promise<void> => {
const enabled = process.env.TELEMETRY_ENABLED === undefined || process.env.TELEMETRY_ENABLED === 'true';
console.log('Telemetry enabled:', enabled);
if (!enabled) {
return;
}
const telemetry: TelemetryData = {
route,
apiVersion: `${packageJson.version}`,
timestamp: new Date(),
};
const url = process.env.TELEMETRY_URL || 'https://log.evolution-api.com/telemetry';
axios
.post('https://log.evolution-api.com/telemetry', telemetry)
.post(url, telemetry)
.then(() => {})
.catch(() => {});
};