mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
refactor: Enhance type definitions and improve code clarity across multiple components and files
This commit is contained in:
@@ -91,7 +91,9 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
}
|
||||
}
|
||||
|
||||
const getServiceInfo = (span: Span): { color: Color; name: string } => {
|
||||
const getServiceInfo: (span: Span) => { color: Color; name: string } = (
|
||||
span: Span,
|
||||
): { color: Color; name: string } => {
|
||||
const service: Service | undefined = telemetryServices.find(
|
||||
(s: Service) => {
|
||||
return s._id?.toString() === span.serviceId?.toString();
|
||||
@@ -103,7 +105,10 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
};
|
||||
};
|
||||
|
||||
const buildNode = (span: Span, depth: number): FlameGraphNode => {
|
||||
const buildNode: (span: Span, depth: number) => FlameGraphNode = (
|
||||
span: Span,
|
||||
depth: number,
|
||||
): FlameGraphNode => {
|
||||
const children: Span[] = childrenMap.get(span.spanId!) || [];
|
||||
const selfTime: SpanSelfTime | undefined = selfTimes.get(span.spanId!);
|
||||
const serviceInfo: { color: Color; name: string } = getServiceInfo(span);
|
||||
@@ -156,7 +161,9 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
// Find max depth for height calculation
|
||||
const maxDepth: number = React.useMemo(() => {
|
||||
let max: number = 0;
|
||||
const traverse = (node: FlameGraphNode): void => {
|
||||
const traverse: (node: FlameGraphNode) => void = (
|
||||
node: FlameGraphNode,
|
||||
): void => {
|
||||
if (node.depth > max) {
|
||||
max = node.depth;
|
||||
}
|
||||
@@ -176,7 +183,9 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
return { viewStart: traceStart, viewEnd: traceEnd };
|
||||
}
|
||||
|
||||
const findNode = (nodes: FlameGraphNode[]): FlameGraphNode | null => {
|
||||
const findNode: (nodes: FlameGraphNode[]) => FlameGraphNode | null = (
|
||||
nodes: FlameGraphNode[],
|
||||
): FlameGraphNode | null => {
|
||||
for (const node of nodes) {
|
||||
if (node.span.spanId === focusedSpanId) {
|
||||
return node;
|
||||
@@ -211,7 +220,9 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
);
|
||||
}
|
||||
|
||||
const renderNode = (node: FlameGraphNode): ReactElement | null => {
|
||||
const renderNode: (node: FlameGraphNode) => ReactElement | null = (
|
||||
node: FlameGraphNode,
|
||||
): ReactElement | null => {
|
||||
// Calculate position relative to view
|
||||
const nodeStart: number = Math.max(node.startTimeUnixNano, viewStart);
|
||||
const nodeEnd: number = Math.min(node.endTimeUnixNano, viewEnd);
|
||||
@@ -299,7 +310,9 @@ const FlameGraph: FunctionComponent<FlameGraphProps> = (
|
||||
if (!hoveredSpanId) {
|
||||
return null;
|
||||
}
|
||||
const findNode = (nodes: FlameGraphNode[]): FlameGraphNode | null => {
|
||||
const findNode: (nodes: FlameGraphNode[]) => FlameGraphNode | null = (
|
||||
nodes: FlameGraphNode[],
|
||||
): FlameGraphNode | null => {
|
||||
for (const node of nodes) {
|
||||
if (node.span.spanId === hoveredSpanId) {
|
||||
return node;
|
||||
|
||||
@@ -125,7 +125,8 @@ const TraceServiceMap: FunctionComponent<TraceServiceMapProps> = (
|
||||
return maxEnd - minStart;
|
||||
}, [spans]);
|
||||
|
||||
const divisibilityFactor = SpanUtil.getDivisibilityFactor(traceDuration);
|
||||
const divisibilityFactor: number =
|
||||
SpanUtil.getDivisibilityFactor(traceDuration);
|
||||
|
||||
if (nodes.length === 0) {
|
||||
return (
|
||||
|
||||
@@ -86,22 +86,24 @@ const KubernetesClusterEvents: FunctionComponent<
|
||||
});
|
||||
|
||||
// Helper to extract a string value from OTLP kvlistValue
|
||||
const getKvValue = (
|
||||
const getKvValue: (
|
||||
kvList: JSONObject | undefined,
|
||||
key: string,
|
||||
): string => {
|
||||
) => string = (kvList: JSONObject | undefined, key: string): string => {
|
||||
if (!kvList) {
|
||||
return "";
|
||||
}
|
||||
const values = (kvList as JSONObject)["values"] as
|
||||
| Array<JSONObject>
|
||||
| undefined;
|
||||
const values: Array<JSONObject> | undefined = (kvList as JSONObject)[
|
||||
"values"
|
||||
] as Array<JSONObject> | undefined;
|
||||
if (!values) {
|
||||
return "";
|
||||
}
|
||||
for (const entry of values) {
|
||||
if (entry["key"] === key) {
|
||||
const val = entry["value"] as JSONObject | undefined;
|
||||
const val: JSONObject | undefined = entry["value"] as
|
||||
| JSONObject
|
||||
| undefined;
|
||||
if (!val) {
|
||||
return "";
|
||||
}
|
||||
@@ -121,7 +123,11 @@ const KubernetesClusterEvents: FunctionComponent<
|
||||
};
|
||||
|
||||
// Helper to get nested kvlist value
|
||||
const getNestedKvValue = (
|
||||
const getNestedKvValue: (
|
||||
kvList: JSONObject | undefined,
|
||||
parentKey: string,
|
||||
childKey: string,
|
||||
) => string = (
|
||||
kvList: JSONObject | undefined,
|
||||
parentKey: string,
|
||||
childKey: string,
|
||||
@@ -129,15 +135,17 @@ const KubernetesClusterEvents: FunctionComponent<
|
||||
if (!kvList) {
|
||||
return "";
|
||||
}
|
||||
const values = (kvList as JSONObject)["values"] as
|
||||
| Array<JSONObject>
|
||||
| undefined;
|
||||
const values: Array<JSONObject> | undefined = (kvList as JSONObject)[
|
||||
"values"
|
||||
] as Array<JSONObject> | undefined;
|
||||
if (!values) {
|
||||
return "";
|
||||
}
|
||||
for (const entry of values) {
|
||||
if (entry["key"] === parentKey) {
|
||||
const val = entry["value"] as JSONObject | undefined;
|
||||
const val: JSONObject | undefined = entry["value"] as
|
||||
| JSONObject
|
||||
| undefined;
|
||||
if (val && val["kvlistValue"]) {
|
||||
return getKvValue(val["kvlistValue"] as JSONObject, childKey);
|
||||
}
|
||||
@@ -179,17 +187,20 @@ const KubernetesClusterEvents: FunctionComponent<
|
||||
}
|
||||
|
||||
// The body has a top-level kvlistValue with "type" (ADDED/MODIFIED) and "object" keys
|
||||
const topKvList = bodyObj["kvlistValue"] as JSONObject | undefined;
|
||||
const topKvList: JSONObject | undefined = bodyObj["kvlistValue"] as
|
||||
| JSONObject
|
||||
| undefined;
|
||||
if (!topKvList) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Get the "object" which is the actual k8s Event
|
||||
const objectKvListRaw = getKvValue(topKvList, "object");
|
||||
const objectKvListRaw: string = getKvValue(topKvList, "object");
|
||||
if (!objectKvListRaw || typeof objectKvListRaw === "string") {
|
||||
continue;
|
||||
}
|
||||
const objectKvList = objectKvListRaw as unknown as JSONObject;
|
||||
const objectKvList: JSONObject =
|
||||
objectKvListRaw as unknown as JSONObject;
|
||||
|
||||
const eventType: string = getKvValue(objectKvList, "type") || "";
|
||||
const reason: string = getKvValue(objectKvList, "reason") || "";
|
||||
|
||||
@@ -4,7 +4,9 @@ import Navigation from "Common/UI/Utils/Navigation";
|
||||
import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster";
|
||||
import MetricView from "../../../Components/Metrics/MetricView";
|
||||
import MetricViewData from "Common/Types/Metrics/MetricViewData";
|
||||
import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import MetricQueryConfigData, {
|
||||
ChartSeries,
|
||||
} from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import AggregationType from "Common/Types/BaseDatabase/AggregationType";
|
||||
import OneUptimeDate from "Common/Types/Date";
|
||||
import InBetween from "Common/Types/BaseDatabase/InBetween";
|
||||
@@ -21,7 +23,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader";
|
||||
import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage";
|
||||
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
|
||||
import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel";
|
||||
import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
|
||||
const KubernetesClusterNodes: FunctionComponent<
|
||||
PageComponentProps
|
||||
@@ -68,7 +69,9 @@ const KubernetesClusterNodes: FunctionComponent<
|
||||
const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6);
|
||||
const startAndEndDate: InBetween<Date> = new InBetween(startDate, endDate);
|
||||
|
||||
const getNodeSeries = (data: AggregateModel): ChartSeries => {
|
||||
const getNodeSeries: (data: AggregateModel) => ChartSeries = (
|
||||
data: AggregateModel,
|
||||
): ChartSeries => {
|
||||
const attributes: Record<string, unknown> =
|
||||
(data["attributes"] as Record<string, unknown>) || {};
|
||||
const nodeName: string =
|
||||
|
||||
@@ -6,7 +6,9 @@ import Card from "Common/UI/Components/Card/Card";
|
||||
import InfoCard from "Common/UI/Components/InfoCard/InfoCard";
|
||||
import MetricView from "../../../Components/Metrics/MetricView";
|
||||
import MetricViewData from "Common/Types/Metrics/MetricViewData";
|
||||
import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import MetricQueryConfigData, {
|
||||
ChartSeries,
|
||||
} from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import AggregationType from "Common/Types/BaseDatabase/AggregationType";
|
||||
import OneUptimeDate from "Common/Types/Date";
|
||||
import InBetween from "Common/Types/BaseDatabase/InBetween";
|
||||
@@ -23,7 +25,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader";
|
||||
import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage";
|
||||
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
|
||||
import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel";
|
||||
import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
|
||||
const KubernetesClusterPodDetail: FunctionComponent<
|
||||
PageComponentProps
|
||||
@@ -76,7 +77,9 @@ const KubernetesClusterPodDetail: FunctionComponent<
|
||||
const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6);
|
||||
const startAndEndDate: InBetween<Date> = new InBetween(startDate, endDate);
|
||||
|
||||
const getContainerSeries = (data: AggregateModel): ChartSeries => {
|
||||
const getContainerSeries: (data: AggregateModel) => ChartSeries = (
|
||||
data: AggregateModel,
|
||||
): ChartSeries => {
|
||||
const attributes: Record<string, unknown> =
|
||||
(data["attributes"] as Record<string, unknown>) || {};
|
||||
const containerName: string =
|
||||
|
||||
@@ -4,7 +4,9 @@ import Navigation from "Common/UI/Utils/Navigation";
|
||||
import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster";
|
||||
import MetricView from "../../../Components/Metrics/MetricView";
|
||||
import MetricViewData from "Common/Types/Metrics/MetricViewData";
|
||||
import MetricQueryConfigData from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import MetricQueryConfigData, {
|
||||
ChartSeries,
|
||||
} from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
import AggregationType from "Common/Types/BaseDatabase/AggregationType";
|
||||
import OneUptimeDate from "Common/Types/Date";
|
||||
import InBetween from "Common/Types/BaseDatabase/InBetween";
|
||||
@@ -21,7 +23,6 @@ import PageLoader from "Common/UI/Components/Loader/PageLoader";
|
||||
import ErrorMessage from "Common/UI/Components/ErrorMessage/ErrorMessage";
|
||||
import { PromiseVoidFunction } from "Common/Types/FunctionTypes";
|
||||
import AggregateModel from "Common/Types/BaseDatabase/AggregatedModel";
|
||||
import { ChartSeries } from "Common/Types/Metrics/MetricQueryConfigData";
|
||||
|
||||
const KubernetesClusterPods: FunctionComponent<
|
||||
PageComponentProps
|
||||
@@ -68,7 +69,9 @@ const KubernetesClusterPods: FunctionComponent<
|
||||
const startDate: Date = OneUptimeDate.addRemoveHours(endDate, -6);
|
||||
const startAndEndDate: InBetween<Date> = new InBetween(startDate, endDate);
|
||||
|
||||
const getPodSeries = (data: AggregateModel): ChartSeries => {
|
||||
const getPodSeries: (data: AggregateModel) => ChartSeries = (
|
||||
data: AggregateModel,
|
||||
): ChartSeries => {
|
||||
const attributes: Record<string, unknown> =
|
||||
(data["attributes"] as Record<string, unknown>) || {};
|
||||
const podName: string =
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
export class MigrationName1773761409952 implements MigrationInterface {
|
||||
name = "MigrationName1773761409952";
|
||||
public name = "MigrationName1773761409952";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
|
||||
@@ -206,9 +206,10 @@ export default class CriticalPathUtil {
|
||||
const criticalPathCache: Map<string, { weight: number; path: string[] }> =
|
||||
new Map();
|
||||
|
||||
const computeWeight = (
|
||||
spanId: string,
|
||||
): { weight: number; path: string[] } => {
|
||||
const computeWeight: (spanId: string) => {
|
||||
weight: number;
|
||||
path: string[];
|
||||
} = (spanId: string): { weight: number; path: string[] } => {
|
||||
const cached: { weight: number; path: string[] } | undefined =
|
||||
criticalPathCache.get(spanId);
|
||||
if (cached) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if .Values.aiAgent.enabled }}
|
||||
{{- if and .Values.aiAgent.enabled (not .Values.deployment.disableDeployments) }}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.app.enabled }}
|
||||
{{- if and $.Values.app.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime app Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -137,7 +137,7 @@ spec:
|
||||
---
|
||||
{{- end }}
|
||||
|
||||
{{- if $.Values.app.enabled }}
|
||||
{{- if and $.Values.app.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime app Service
|
||||
{{- $appPorts := dict "port" $.Values.app.ports.http -}}
|
||||
{{- $appServiceArgs := dict "ServiceName" "app" "Ports" $appPorts "Release" $.Release "Values" $.Values -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.cronJobs.cleanup.enabled }}
|
||||
{{- if and $.Values.cronJobs.cleanup.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
|
||||
apiVersion: batch/v1
|
||||
kind: CronJob
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.home.enabled }}
|
||||
{{- if and $.Values.home.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime Home Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -126,7 +126,7 @@ spec:
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if $.Values.home.enabled }}
|
||||
{{- if and $.Values.home.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime home Service
|
||||
{{- $homePorts := $.Values.home.ports -}}
|
||||
{{- $homeServiceArgs := dict "ServiceName" "home" "Ports" $homePorts "Release" $.Release "Values" $.Values -}}
|
||||
|
||||
@@ -3,7 +3,7 @@ KEDA ScaledObjects for various services
|
||||
*/}}
|
||||
|
||||
{{/* Telemetry KEDA ScaledObject */}}
|
||||
{{- if and .Values.keda.enabled .Values.telemetry.enabled .Values.telemetry.keda.enabled (not .Values.telemetry.disableAutoscaler) }}
|
||||
{{- if and .Values.keda.enabled .Values.telemetry.enabled .Values.telemetry.keda.enabled (not .Values.telemetry.disableAutoscaler) (not .Values.deployment.disableDeployments) }}
|
||||
{{- $metricsConfig := dict "enabled" .Values.telemetry.keda.enabled "minReplicas" .Values.telemetry.keda.minReplicas "maxReplicas" .Values.telemetry.keda.maxReplicas "pollingInterval" .Values.telemetry.keda.pollingInterval "cooldownPeriod" .Values.telemetry.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_telemetry_queue_size" "threshold" .Values.telemetry.keda.queueSizeThreshold "port" .Values.telemetry.ports.http)) }}
|
||||
{{- $telemetryKedaArgs := dict "ServiceName" "telemetry" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.telemetry.disableAutoscaler }}
|
||||
{{- include "oneuptime.kedaScaledObject" $telemetryKedaArgs }}
|
||||
@@ -12,7 +12,7 @@ KEDA ScaledObjects for various services
|
||||
{{/* Probe KEDA ScaledObjects - one for each probe configuration */}}
|
||||
{{- range $key, $val := $.Values.probes }}
|
||||
{{- $probeEnabled := or (not (hasKey $val "enabled")) $val.enabled }}
|
||||
{{- if and $.Values.keda.enabled $probeEnabled (and $val.keda $val.keda.enabled) (not $val.disableAutoscaler) }}
|
||||
{{- if and $.Values.keda.enabled $probeEnabled (and $val.keda $val.keda.enabled) (not $val.disableAutoscaler) (not $.Values.deployment.disableDeployments) }}
|
||||
{{- $serviceName := printf "probe-%s" $key }}
|
||||
{{- $probePort := 3874 }}
|
||||
{{- if and $val.ports $val.ports.http }}
|
||||
@@ -25,14 +25,14 @@ KEDA ScaledObjects for various services
|
||||
{{- end }}
|
||||
|
||||
{{/* Worker KEDA ScaledObject */}}
|
||||
{{- if and .Values.keda.enabled .Values.worker.enabled .Values.worker.keda.enabled (not .Values.worker.disableAutoscaler) }}
|
||||
{{- if and .Values.keda.enabled .Values.worker.enabled .Values.worker.keda.enabled (not .Values.worker.disableAutoscaler) (not .Values.deployment.disableDeployments) }}
|
||||
{{- $metricsConfig := dict "enabled" .Values.worker.keda.enabled "minReplicas" .Values.worker.keda.minReplicas "maxReplicas" .Values.worker.keda.maxReplicas "pollingInterval" .Values.worker.keda.pollingInterval "cooldownPeriod" .Values.worker.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_worker_queue_size" "threshold" .Values.worker.keda.queueSizeThreshold "port" .Values.worker.ports.http)) }}
|
||||
{{- $workerKedaArgs := dict "ServiceName" "worker" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.worker.disableAutoscaler }}
|
||||
{{- include "oneuptime.kedaScaledObject" $workerKedaArgs }}
|
||||
{{- end }}
|
||||
|
||||
{{/* AI Agent KEDA ScaledObject */}}
|
||||
{{- if and .Values.keda.enabled .Values.aiAgent.enabled .Values.aiAgent.keda.enabled (not .Values.aiAgent.disableAutoscaler) }}
|
||||
{{- if and .Values.keda.enabled .Values.aiAgent.enabled .Values.aiAgent.keda.enabled (not .Values.aiAgent.disableAutoscaler) (not .Values.deployment.disableDeployments) }}
|
||||
{{- $metricsConfig := dict "enabled" .Values.aiAgent.keda.enabled "minReplicas" .Values.aiAgent.keda.minReplicas "maxReplicas" .Values.aiAgent.keda.maxReplicas "pollingInterval" .Values.aiAgent.keda.pollingInterval "cooldownPeriod" .Values.aiAgent.keda.cooldownPeriod "triggers" (list (dict "query" "oneuptime_ai_agent_queue_size" "threshold" .Values.aiAgent.keda.queueSizeThreshold "port" .Values.aiAgent.ports.http)) }}
|
||||
{{- $aiAgentKedaArgs := dict "ServiceName" "ai-agent" "Release" .Release "Values" .Values "MetricsConfig" $metricsConfig "DisableAutoscaler" .Values.aiAgent.disableAutoscaler }}
|
||||
{{- include "oneuptime.kedaScaledObject" $aiAgentKedaArgs }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.nginx.enabled }}
|
||||
{{- if and $.Values.nginx.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
|
||||
# OneUptime nginx Deployment
|
||||
apiVersion: apps/v1
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
{{- if not $.Values.deployment.disableDeployments }}
|
||||
{{- range $key, $val := $.Values.probes }}
|
||||
{{- if or (not (hasKey $val "enabled")) $val.enabled }}
|
||||
apiVersion: apps/v1
|
||||
@@ -166,3 +167,4 @@ spec:
|
||||
---
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.telemetry.enabled }}
|
||||
{{- if and $.Values.telemetry.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime telemetry Deployment
|
||||
|
||||
apiVersion: apps/v1
|
||||
@@ -137,7 +137,7 @@ spec:
|
||||
|
||||
---
|
||||
|
||||
{{- if $.Values.telemetry.enabled }}
|
||||
{{- if and $.Values.telemetry.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime telemetry Service
|
||||
{{- $telemetryPorts := dict "http" $.Values.telemetry.ports.http "grpc" $.Values.telemetry.ports.grpc -}}
|
||||
{{- $telemetryServiceArgs := dict "ServiceName" "telemetry" "Ports" $telemetryPorts "Release" $.Release "Values" $.Values -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.testServer.enabled }}
|
||||
{{- if and $.Values.testServer.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
|
||||
# OneUptime test-server Deployment
|
||||
{{- $testServerPorts := $.Values.testServer.ports -}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{{- if $.Values.worker.enabled }}
|
||||
{{- if and $.Values.worker.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime worker Deployment
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
@@ -128,7 +128,7 @@ spec:
|
||||
|
||||
---
|
||||
|
||||
{{- if $.Values.worker.enabled }}
|
||||
{{- if and $.Values.worker.enabled (not $.Values.deployment.disableDeployments) }}
|
||||
# OneUptime worker Service
|
||||
{{- $workerPorts := $.Values.worker.ports -}}
|
||||
{{- $workerServiceArgs := dict "ServiceName" "worker" "Ports" $workerPorts "Release" $.Release "Values" $.Values -}}
|
||||
|
||||
@@ -86,6 +86,11 @@
|
||||
"deployment": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"disableDeployments": {
|
||||
"type": "boolean",
|
||||
"description": "When set to true, no OneUptime deployments are provisioned. Only databases (Redis, ClickHouse, Postgres) will be running.",
|
||||
"default": false
|
||||
},
|
||||
"includeTimestampLabel": {
|
||||
"type": "boolean"
|
||||
},
|
||||
|
||||
@@ -48,6 +48,8 @@ externalSecrets:
|
||||
passwordKey:
|
||||
|
||||
deployment:
|
||||
# When set to true, no OneUptime deployments are provisioned. Only databases (Redis, ClickHouse, Postgres) will be running.
|
||||
disableDeployments: false
|
||||
# Default replica count for all deployments
|
||||
replicaCount: 1
|
||||
# Update strategy type for all deployments
|
||||
|
||||
@@ -17,7 +17,7 @@ function toDisplayString(val: unknown): string {
|
||||
}
|
||||
if (typeof val === "object") {
|
||||
// Handle OneUptime typed objects like URL { _type, value }
|
||||
const obj = val as Record<string, unknown>;
|
||||
const obj: Record<string, unknown> = val as Record<string, unknown>;
|
||||
if (typeof obj.value === "string") {
|
||||
return obj.value;
|
||||
}
|
||||
@@ -674,7 +674,7 @@ export default function MonitorSummaryView({
|
||||
return getProbeResponse(probe);
|
||||
}, [probeItems, selectedProbeIndex]);
|
||||
|
||||
const renderContent = (): React.JSX.Element => {
|
||||
const renderContent: () => React.JSX.Element = (): React.JSX.Element => {
|
||||
if (!latestResponse) {
|
||||
return (
|
||||
<View style={{ padding: 20, alignItems: "center" }}>
|
||||
|
||||
@@ -4,10 +4,8 @@ import {
|
||||
fetchMonitorFeed,
|
||||
fetchMonitorStatusTimeline,
|
||||
fetchMonitorProbes,
|
||||
} from "../api/monitors";
|
||||
import type {
|
||||
MonitorStatusTimelineItem,
|
||||
MonitorProbeItem,
|
||||
type MonitorStatusTimelineItem,
|
||||
type MonitorProbeItem,
|
||||
} from "../api/monitors";
|
||||
import type { MonitorItem, FeedItem } from "../api/types";
|
||||
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import { ExpressRequest } from "Common/Server/Utils/Express";
|
||||
import CaptureSpan from "Common/Server/Utils/Telemetry/CaptureSpan";
|
||||
import { JSONArray, JSONObject } from "Common/Types/JSON";
|
||||
import { JSONArray, JSONObject, JSONValue } from "Common/Types/JSON";
|
||||
import ObjectID from "Common/Types/ObjectID";
|
||||
import KubernetesClusterService from "Common/Server/Services/KubernetesClusterService";
|
||||
import KubernetesCluster from "Common/Models/DatabaseModels/KubernetesCluster";
|
||||
import logger from "Common/Server/Utils/Logger";
|
||||
|
||||
export default abstract class OtelIngestBaseService {
|
||||
@@ -46,7 +47,9 @@ export default abstract class OtelIngestBaseService {
|
||||
attribute["value"] &&
|
||||
(attribute["value"] as JSONObject)["stringValue"]
|
||||
) {
|
||||
const value = (attribute["value"] as JSONObject)["stringValue"];
|
||||
const value: JSONValue = (attribute["value"] as JSONObject)[
|
||||
"stringValue"
|
||||
];
|
||||
if (typeof value === "string" && value.trim()) {
|
||||
return value.trim();
|
||||
}
|
||||
@@ -69,7 +72,7 @@ export default abstract class OtelIngestBaseService {
|
||||
return;
|
||||
}
|
||||
|
||||
const cluster =
|
||||
const cluster: KubernetesCluster =
|
||||
await KubernetesClusterService.findOrCreateByClusterIdentifier({
|
||||
projectId: data.projectId,
|
||||
clusterIdentifier: clusterName,
|
||||
|
||||
Reference in New Issue
Block a user