mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Update telemetry environment variables
This commit is contained in:
parent
5dc625c34b
commit
17fbae7cd5
@ -31,12 +31,12 @@ export default class OneUptimeTelemetry {
|
|||||||
public static logger: Logger | null = null;
|
public static logger: Logger | null = null;
|
||||||
|
|
||||||
public static getHeaders(): Dictionary<string> {
|
public static getHeaders(): Dictionary<string> {
|
||||||
if (!process.env['OTEL_EXPORTER_OTLP_HEADERS']) {
|
if (!process.env['OPENTELEMETRY_EXPORTER_OTLP_HEADERS']) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
const headersStrings: Array<string> =
|
const headersStrings: Array<string> =
|
||||||
process.env['OTEL_EXPORTER_OTLP_HEADERS'].split(';');
|
process.env['OPENTELEMETRY_EXPORTER_OTLP_HEADERS'].split(';');
|
||||||
|
|
||||||
const headers: Dictionary<string> = {};
|
const headers: Dictionary<string> = {};
|
||||||
|
|
||||||
@ -51,11 +51,11 @@ export default class OneUptimeTelemetry {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static getOtlpEndpoint(): URL | null {
|
public static getOtlpEndpoint(): URL | null {
|
||||||
if (!process.env['OTEL_EXPORTER_OTLP_ENDPOINT']) {
|
if (!process.env['OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT']) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return URL.fromString(process.env['OTEL_EXPORTER_OTLP_ENDPOINT'] || '');
|
return URL.fromString(process.env['OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT'] || '');
|
||||||
}
|
}
|
||||||
|
|
||||||
public static getOltpLogsEndpoint(): URL | null {
|
public static getOltpLogsEndpoint(): URL | null {
|
||||||
@ -113,6 +113,8 @@ export default class OneUptimeTelemetry {
|
|||||||
traceExporter = new OTLPTraceExporter({
|
traceExporter = new OTLPTraceExporter({
|
||||||
url: this.getOltpTracesEndpoint()!.toString(),
|
url: this.getOltpTracesEndpoint()!.toString(),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
|
compression: CompressionAlgorithm.GZIP,
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -121,6 +123,7 @@ export default class OneUptimeTelemetry {
|
|||||||
exporter: new OTLPMetricExporter({
|
exporter: new OTLPMetricExporter({
|
||||||
url: this.getOltpMetricsEndpoint()!.toString(),
|
url: this.getOltpMetricsEndpoint()!.toString(),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
|
compression: CompressionAlgorithm.GZIP,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -131,7 +134,7 @@ export default class OneUptimeTelemetry {
|
|||||||
const logExporter: OTLPLogExporter = new OTLPLogExporter({
|
const logExporter: OTLPLogExporter = new OTLPLogExporter({
|
||||||
url: this.getOltpLogsEndpoint()!.toString(),
|
url: this.getOltpLogsEndpoint()!.toString(),
|
||||||
headers: headers,
|
headers: headers,
|
||||||
compression: CompressionAlgorithm.GZIP,
|
compression: CompressionAlgorithm.GZIP,
|
||||||
});
|
});
|
||||||
|
|
||||||
loggerProvider.addLogRecordProcessor(
|
loggerProvider.addLogRecordProcessor(
|
||||||
|
@ -62,9 +62,7 @@ class OpenTelemetryRequestMiddleware {
|
|||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
try {
|
try {
|
||||||
let productType: ProductType;
|
let productType: ProductType;
|
||||||
|
|
||||||
debugger;
|
|
||||||
|
|
||||||
const isProtobuf: boolean = req.body instanceof Uint8Array;
|
const isProtobuf: boolean = req.body instanceof Uint8Array;
|
||||||
|
|
||||||
if (req.url.includes('/otlp/v1/traces')) {
|
if (req.url.includes('/otlp/v1/traces')) {
|
||||||
|
@ -234,8 +234,8 @@ services:
|
|||||||
INTERNAL_SMTP_EMAIL: ${INTERNAL_SMTP_EMAIL}
|
INTERNAL_SMTP_EMAIL: ${INTERNAL_SMTP_EMAIL}
|
||||||
INTERNAL_SMTP_FROM_NAME: ${INTERNAL_SMTP_FROM_NAME}
|
INTERNAL_SMTP_FROM_NAME: ${INTERNAL_SMTP_FROM_NAME}
|
||||||
INTERNAL_SMTP_PASSWORD: ${INTERNAL_SMTP_PASSWORD}
|
INTERNAL_SMTP_PASSWORD: ${INTERNAL_SMTP_PASSWORD}
|
||||||
OTEL_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT}
|
OPENTELEMETRY_EXPORTER_OTLP_ENDPOINT: ${OTEL_EXPORTER_OTLP_ENDPOINT}
|
||||||
OTEL_EXPORTER_OTLP_HEADERS: ${APP_OTEL_EXPORTER_OTLP_HEADERS}
|
OPENTELEMETRY_EXPORTER_OTLP_HEADERS: ${APP_OTEL_EXPORTER_OTLP_HEADERS}
|
||||||
depends_on:
|
depends_on:
|
||||||
- redis
|
- redis
|
||||||
- postgres
|
- postgres
|
||||||
|
Loading…
Reference in New Issue
Block a user