Skip to content

Commit

Permalink
Remove commented-out telemetry indexing and billing logic from OTelIn…
Browse files Browse the repository at this point in the history
…gest API
  • Loading branch information
simlarsen committed Dec 9, 2024
1 parent c5134f0 commit 85d0ded
Showing 1 changed file with 46 additions and 48 deletions.
94 changes: 46 additions & 48 deletions OpenTelemetryIngest/API/OTelIngest.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import ArrayUtil from "Common/Utils/Array";
import TelemetryIngest, {
TelemetryRequest,
} from "Common/Server/Middleware/TelemetryIngest";
Expand All @@ -11,12 +10,11 @@ import BadRequestException from "Common/Types/Exception/BadRequestException";
import { JSONArray, JSONObject } from "Common/Types/JSON";
import JSONFunctions from "Common/Types/JSONFunctions";
import ProductType from "Common/Types/MeteredPlan/ProductType";
import TelemetryType from "Common/Types/Telemetry/TelemetryType";
import Text from "Common/Types/Text";
import LogService from "Common/Server/Services/LogService";
import MetricService from "Common/Server/Services/MetricService";
import SpanService from "Common/Server/Services/SpanService";
import ExceptionInstanceService from "Common/Server/Services//ExceptionInstanceService";
import ExceptionInstanceService from "Common/Server/Services/ExceptionInstanceService";
import Express, {
ExpressRequest,
ExpressResponse,
Expand Down Expand Up @@ -398,21 +396,21 @@ router.post(
},
});

TelemetryUtil.indexAttributes({
attributes: ArrayUtil.removeDuplicates(attributes),
projectId: (req as TelemetryRequest).projectId,
telemetryType: TelemetryType.Trace,
}).catch((err: Error) => {
logger.error(err);
});

OTelIngestService.recordDataIngestedUsgaeBilling({
services: serviceDictionary,
projectId: (req as TelemetryRequest).projectId,
productType: ProductType.Traces,
}).catch((err: Error) => {
logger.error(err);
});
// TelemetryUtil.indexAttributes({
// attributes: ArrayUtil.removeDuplicates(attributes),
// projectId: (req as TelemetryRequest).projectId,
// telemetryType: TelemetryType.Trace,
// }).catch((err: Error) => {
// logger.error(err);
// });

// OTelIngestService.recordDataIngestedUsgaeBilling({
// services: serviceDictionary,
// projectId: (req as TelemetryRequest).projectId,
// productType: ProductType.Traces,
// }).catch((err: Error) => {
// logger.error(err);
// });
} catch (err) {
return next(err);
}
Expand Down Expand Up @@ -679,21 +677,21 @@ router.post(
},
});

TelemetryUtil.indexAttributes({
attributes: ArrayUtil.removeDuplicates(attributes),
projectId: (req as TelemetryRequest).projectId,
telemetryType: TelemetryType.Metric,
}).catch((err: Error) => {
logger.error(err);
});

OTelIngestService.recordDataIngestedUsgaeBilling({
services: serviceDictionary,
projectId: (req as TelemetryRequest).projectId,
productType: ProductType.Metrics,
}).catch((err: Error) => {
logger.error(err);
});
// TelemetryUtil.indexAttributes({
// attributes: ArrayUtil.removeDuplicates(attributes),
// projectId: (req as TelemetryRequest).projectId,
// telemetryType: TelemetryType.Metric,
// }).catch((err: Error) => {
// logger.error(err);
// });

// OTelIngestService.recordDataIngestedUsgaeBilling({
// services: serviceDictionary,
// projectId: (req as TelemetryRequest).projectId,
// productType: ProductType.Metrics,
// }).catch((err: Error) => {
// logger.error(err);
// });
} catch (err) {
return next(err);
}
Expand Down Expand Up @@ -906,21 +904,21 @@ router.post(
},
});

TelemetryUtil.indexAttributes({
attributes: ArrayUtil.removeDuplicates(attributes),
projectId: (req as TelemetryRequest).projectId,
telemetryType: TelemetryType.Log,
}).catch((err: Error) => {
logger.error(err);
});

OTelIngestService.recordDataIngestedUsgaeBilling({
services: serviceDictionary,
projectId: (req as TelemetryRequest).projectId,
productType: ProductType.Logs,
}).catch((err: Error) => {
logger.error(err);
});
// TelemetryUtil.indexAttributes({
// attributes: ArrayUtil.removeDuplicates(attributes),
// projectId: (req as TelemetryRequest).projectId,
// telemetryType: TelemetryType.Log,
// }).catch((err: Error) => {
// logger.error(err);
// });

// OTelIngestService.recordDataIngestedUsgaeBilling({
// services: serviceDictionary,
// projectId: (req as TelemetryRequest).projectId,
// productType: ProductType.Logs,
// }).catch((err: Error) => {
// logger.error(err);
// });
} catch (err) {
return next(err);
}
Expand Down

0 comments on commit 85d0ded

Please sign in to comment.