mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor Telemetry and TelemetryIngest classes to use URL class from Common/Types/API/URL
This commit is contained in:
parent
34118d5892
commit
0c7db14e99
@ -14,6 +14,7 @@ import {
|
||||
WebTracerProvider,
|
||||
} from "@opentelemetry/sdk-trace-web";
|
||||
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions";
|
||||
import URL from "Common/Types/API/URL";
|
||||
|
||||
export default class Telemetry {
|
||||
public static init(data: { serviceName: string }): void {
|
||||
@ -32,7 +33,7 @@ export default class Telemetry {
|
||||
provider.addSpanProcessor(
|
||||
new BatchSpanProcessor(
|
||||
new OTLPTraceExporter({
|
||||
url: OpenTelemetryExporterOtlpEndpoint?.toString() + "/v1/traces",
|
||||
url: URL.fromString(OpenTelemetryExporterOtlpEndpoint?.toString() + "/v1/traces").toString(),
|
||||
headers: OpenTelemetryExporterOtlpHeaders,
|
||||
}),
|
||||
),
|
||||
|
@ -62,7 +62,7 @@ export default class TelemetryIngest {
|
||||
});
|
||||
|
||||
if (!service) {
|
||||
throw new BadRequestException("Invalid service token");
|
||||
throw new BadRequestException("Invalid service token: "+serviceTokenInHeader);
|
||||
}
|
||||
|
||||
(req as TelemetryRequest).serviceId = service.id as ObjectID;
|
||||
|
Loading…
Reference in New Issue
Block a user