mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Fix formatting issues and update dependencies
This commit is contained in:
parent
07ab132946
commit
ccb960f30e
@ -4,7 +4,7 @@ export default class Text {
|
||||
return textInBase64;
|
||||
}
|
||||
|
||||
if(!this.isBase64(textInBase64)) {
|
||||
if (!this.isBase64(textInBase64)) {
|
||||
return textInBase64;
|
||||
}
|
||||
|
||||
@ -14,10 +14,9 @@ export default class Text {
|
||||
const hex: string = raw.charCodeAt(i).toString(16);
|
||||
result += hex.length === 2 ? hex : '0' + hex;
|
||||
}
|
||||
return result.toUpperCase();
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
public static isBase64(text: string): boolean {
|
||||
const regex: RegExp = /^[a-zA-Z0-9+/]*={0,2}$/;
|
||||
return regex.test(text);
|
||||
|
@ -1,5 +1,4 @@
|
||||
import { registerInstrumentations } from '@opentelemetry/instrumentation';
|
||||
import { getWebAutoInstrumentations } from '@opentelemetry/auto-instrumentations-web';
|
||||
import {
|
||||
BatchSpanProcessor,
|
||||
TracerConfig,
|
||||
@ -13,6 +12,8 @@ import {
|
||||
OpenTelemetryExporterOtlpEndpoint,
|
||||
OpenTelemetryExporterOtlpHeaders,
|
||||
} from '../Config';
|
||||
import {FetchInstrumentation} from '@opentelemetry/instrumentation-fetch';
|
||||
import { XMLHttpRequestInstrumentation } from "@opentelemetry/instrumentation-xml-http-request";
|
||||
|
||||
const providerConfig: TracerConfig = {
|
||||
resource: new Resource({
|
||||
@ -29,7 +30,9 @@ if (OpenTelemetryExporterOtlpEndpoint) {
|
||||
provider.addSpanProcessor(
|
||||
new BatchSpanProcessor(
|
||||
new OTLPTraceExporter({
|
||||
url: OpenTelemetryExporterOtlpEndpoint?.toString() + '/v1/traces',
|
||||
url:
|
||||
OpenTelemetryExporterOtlpEndpoint?.toString() +
|
||||
'/v1/traces',
|
||||
headers: OpenTelemetryExporterOtlpHeaders,
|
||||
})
|
||||
)
|
||||
@ -42,12 +45,7 @@ provider.register({
|
||||
|
||||
registerInstrumentations({
|
||||
instrumentations: [
|
||||
// getWebAutoInstrumentations initializes all the package.
|
||||
// it's possible to configure each instrumentation if needed.
|
||||
getWebAutoInstrumentations({
|
||||
'@opentelemetry/instrumentation-fetch': {
|
||||
enabled: true,
|
||||
},
|
||||
}),
|
||||
new FetchInstrumentation(),
|
||||
new XMLHttpRequestInstrumentation()
|
||||
],
|
||||
});
|
||||
|
@ -135,9 +135,15 @@ router.post(
|
||||
dbSpan.projectId = (req as TelemetryRequest).projectId;
|
||||
dbSpan.serviceId = (req as TelemetryRequest).serviceId;
|
||||
|
||||
dbSpan.spanId = Text.convertBase64ToHex(span['spanId'] as string);
|
||||
dbSpan.traceId = Text.convertBase64ToHex(span['traceId'] as string);
|
||||
dbSpan.parentSpanId = Text.convertBase64ToHex(span['parentSpanId'] as string);
|
||||
dbSpan.spanId = Text.convertBase64ToHex(
|
||||
span['spanId'] as string
|
||||
);
|
||||
dbSpan.traceId = Text.convertBase64ToHex(
|
||||
span['traceId'] as string
|
||||
);
|
||||
dbSpan.parentSpanId = Text.convertBase64ToHex(
|
||||
span['parentSpanId'] as string
|
||||
);
|
||||
dbSpan.startTimeUnixNano = span[
|
||||
'startTimeUnixNano'
|
||||
] as number;
|
||||
@ -575,8 +581,12 @@ router.post(
|
||||
|
||||
dbLog.body = logBody['stringValue'] as string;
|
||||
|
||||
dbLog.traceId = Text.convertBase64ToHex(log['traceId'] as string);
|
||||
dbLog.spanId = Text.convertBase64ToHex(log['spanId'] as string);
|
||||
dbLog.traceId = Text.convertBase64ToHex(
|
||||
log['traceId'] as string
|
||||
);
|
||||
dbLog.spanId = Text.convertBase64ToHex(
|
||||
log['spanId'] as string
|
||||
);
|
||||
|
||||
// We need to convert this to date.
|
||||
dbLog.attributes = OTelIngestService.getKeyValues(
|
||||
|
Loading…
Reference in New Issue
Block a user