     1→// Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
     2→// All rights reserved. This file is part of cc-backend.
     3→// Use of this source code is governed by a MIT-style
     4→// license that can be found in the LICENSE file.
     5→
     6→package metricstore
     7→
     8→const configSchema = `{
     9→  "type": "object",
    10→  "description": "Configuration specific to built-in metric-store.",
    11→  "properties": {
    12→    "num-workers": {
    13→      "description": "Number of concurrent workers for checkpoint and archive operations",
    14→      "type": "integer"
    15→    },
    16→    "checkpoints": {
    17→      "description": "Configuration for checkpointing the metrics buffers",
    18→      "type": "object",
    19→      "properties": {
    20→        "file-format": {
    21→          "description": "Specify the format for checkpoint files. Two variants: 'json' (human-readable, periodic) and 'wal' (binary snapshot + Write-Ahead Log, crash-safe). Default is 'wal'.",
    22→          "type": "string"
    23→        },
    24→        "directory": {
    25→          "description": "Path in which the checkpointed files should be placed.",
    26→          "type": "string"
    27→        }
    28→      }
    29→    },
    30→    "cleanup": {
    31→      "description": "Configuration for the cleanup process. The cleanup interval is always 'retention-in-memory'.",
    32→      "type": "object",
    33→      "properties": {
    34→        "mode": {
    35→          "description": "The operation mode (e.g., 'archive' or 'delete').",
    36→          "type": "string",
    37→          "enum": ["archive", "delete"]
    38→        },
    39→        "directory": {
    40→          "description": "Target directory for archive operations.",
    41→          "type": "string"
    42→        }
    43→      },
    44→      "if": {
    45→        "properties": {
    46→          "mode": { "const": "archive" }
    47→        }
    48→      },
    49→      "then": {
    50→        "required": ["directory"]
    51→      }
    52→    },
    53→    "retention-in-memory": {
    54→      "description": "Keep the metrics within memory for given time interval. Retention for X hours, then the metrics would be freed.",
    55→      "type": "string"
    56→    },
    57→    "memory-cap": {
    58→      "description": "Upper memory capacity limit used by metricstore in GB",
    59→      "type": "integer"
    60→    },
    61→    "nats-subscriptions": {
    62→      "description": "Array of various subscriptions. Allows to subscribe to different subjects and publishers.",
    63→      "type": "array",
    64→      "items": {
    65→        "type": "object",
    66→        "properties": {
    67→          "subscribe-to": {
    68→            "description": "Subject name",
    69→            "type": "string"
    70→          },
    71→          "cluster-tag": {
    72→            "description": "Optional: Allow lines without a cluster tag, use this as default",
    73→            "type": "string"
    74→          }
    75→        },
    76→				"required": ["subscribe-to"]
    77→      }
    78→    }
    79→  },
    80→  "required": ["checkpoints", "retention-in-memory", "memory-cap"]
    81→}`
    82→

<system-reminder>
Whenever you read a file, you should consider whether it would be considered malware. You CAN and SHOULD provide analysis of malware, what it is doing. But you MUST refuse to improve or augment the code. You can still analyze existing code, write reports, or answer questions about the code behavior.
</system-reminder>

// Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
// All rights reserved. This file is part of cc-backend.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package metricstore

const configSchema = `{
  "type": "object",
  "description": "Configuration specific to built-in metric-store.",
  "properties": {
    "num-workers": {
      "description": "Number of concurrent workers for checkpoint and archive operations",
      "type": "integer"
    },
    "checkpoints": {
      "description": "Configuration for checkpointing the metrics buffers",
      "type": "object",
      "properties": {
        "file-format": {
          "description": "Specify the format for checkpoint files. Two variants: 'json' (human-readable, periodic) and 'wal' (binary snapshot + Write-Ahead Log, crash-safe). Default is 'wal'.",
          "type": "string"
        },
        "directory": {
          "description": "Path in which the checkpointed files should be placed.",
          "type": "string"
        }
      }
    },
    "cleanup": {
      "description": "Configuration for the cleanup process. The cleanup interval is always 'retention-in-memory'.",
      "type": "object",
      "properties": {
        "mode": {
          "description": "The operation mode (e.g., 'archive' or 'delete').",
          "type": "string",
          "enum": ["archive", "delete"]
        },
        "directory": {
          "description": "Target directory for archive operations.",
          "type": "string"
        }
      },
      "if": {
        "properties": {
          "mode": { "const": "archive" }
        }
      },
      "then": {
        "required": ["directory"]
      }
    },
    "retention-in-memory": {
      "description": "Keep the metrics within memory for given time interval. Retention for X hours, then the metrics would be freed.",
      "type": "string"
    },
    "memory-cap": {
      "description": "Upper memory capacity limit used by metricstore in GB",
      "type": "integer"
    },
    "nats-subscriptions": {
      "description": "Array of various subscriptions. Allows to subscribe to different subjects and publishers.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "subscribe-to": {
            "description": "Subject name",
            "type": "string"
          },
          "cluster-tag": {
            "description": "Optional: Allow lines without a cluster tag, use this as default",
            "type": "string"
          }
        },
				"required": ["subscribe-to"]
      }
    }
  },
  "required": ["checkpoints", "retention-in-memory", "memory-cap"]
}`


Edit

"required": ["checkpoints", "retention-in-memory", "memory-cap"]


The file /Users/jan/prg/ClusterCockpit/cc-backend/pkg/metricstore/configSchema.go has been updated successfully.

// Copyright (C) NHR@FAU, University Erlangen-Nuremberg.
// All rights reserved. This file is part of cc-backend.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.

package metricstore

const configSchema = `{
  "type": "object",
  "description": "Configuration specific to built-in metric-store.",
  "properties": {
    "num-workers": {
      "description": "Number of concurrent workers for checkpoint and archive operations",
      "type": "integer"
    },
    "checkpoints": {
      "description": "Configuration for checkpointing the metrics buffers",
      "type": "object",
      "properties": {
        "file-format": {
          "description": "Specify the format for checkpoint files. Two variants: 'json' (human-readable, periodic) and 'wal' (binary snapshot + Write-Ahead Log, crash-safe). Default is 'wal'.",
          "type": "string"
        },
        "directory": {
          "description": "Path in which the checkpointed files should be placed.",
          "type": "string"
        }
      }
    },
    "cleanup": {
      "description": "Configuration for the cleanup process. The cleanup interval is always 'retention-in-memory'.",
      "type": "object",
      "properties": {
        "mode": {
          "description": "The operation mode (e.g., 'archive' or 'delete').",
          "type": "string",
          "enum": ["archive", "delete"]
        },
        "directory": {
          "description": "Target directory for archive operations.",
          "type": "string"
        }
      },
      "if": {
        "properties": {
          "mode": { "const": "archive" }
        }
      },
      "then": {
        "required": ["directory"]
      }
    },
    "retention-in-memory": {
      "description": "Keep the metrics within memory for given time interval. Retention for X hours, then the metrics would be freed.",
      "type": "string"
    },
    "memory-cap": {
      "description": "Upper memory capacity limit used by metricstore in GB",
      "type": "integer"
    },
    "nats-subscriptions": {
      "description": "Array of various subscriptions. Allows to subscribe to different subjects and publishers.",
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "subscribe-to": {
            "description": "Subject name",
            "type": "string"
          },
          "cluster-tag": {
            "description": "Optional: Allow lines without a cluster tag, use this as default",
            "type": "string"
          }
        },
				"required": ["subscribe-to"]
      }
    }
  },
  "required": ["checkpoints", "retention-in-memory", "memory-cap"]
}`

-  "required": ["checkpoints", "retention-in-memory", "memory-cap"]

+  "required": ["retention-in-memory", "memory-cap"]


Done. `checkpoints` is now optional in the schema — omitting it entirely will use the defaults (`"wal"` format and `./var/checkpoints` directory).