mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Update TelemetryIngestor and Probe to initialize telemetry with the correct service name
This refactor updates the TelemetryIngestor and Probe components to initialize telemetry with the correct service name. Previously, the service name was hardcoded or set to a default value, which could lead to inconsistencies and confusion. By using the APP_NAME constant defined in each component, the service name is now dynamically set, ensuring accurate telemetry tracking. Files modified: - TelemetryIngestor/Index.ts - Probe/Index.ts
This commit is contained in:
@@ -4,6 +4,7 @@ import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
|
||||
import Express, { ExpressApplication } from "CommonServer/Utils/Express";
|
||||
import logger from "CommonServer/Utils/Logger";
|
||||
import App from "CommonServer/Utils/StartServer";
|
||||
import Telemetry from "CommonServer/Utils/Telemetry";
|
||||
import "ejs";
|
||||
|
||||
const app: ExpressApplication = Express.getExpressApp();
|
||||
@@ -15,6 +16,11 @@ app.use([`/${APP_NAME}`, "/"], SettingsAPI);
|
||||
|
||||
const init: PromiseVoidFunction = async (): Promise<void> => {
|
||||
try {
|
||||
// Initialize telemetry
|
||||
Telemetry.init({
|
||||
serviceName: APP_NAME,
|
||||
});
|
||||
|
||||
// init the app
|
||||
await App.init({
|
||||
appName: APP_NAME,
|
||||
|
||||
Reference in New Issue
Block a user