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:
Simon Larsen
2024-08-02 16:35:09 -06:00
parent d49a6ce009
commit 0b10880f58
14 changed files with 40 additions and 5100 deletions

View File

@@ -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,