From e323951da1075dbb94efb8585d8b39679a069533 Mon Sep 17 00:00:00 2001 From: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com> Date: Sun, 4 May 2025 07:55:46 +0300 Subject: [PATCH 1/3] feat(opala): added tracing config to opala cron --- .../cron/{v1.configs.json => v2.configs.json} | 3 + schemas/infra/opala/cron/v2.schema.json | 101 ++++++++++++++++++ 2 files changed, 104 insertions(+) rename schemas/infra/opala/cron/{v1.configs.json => v2.configs.json} (82%) create mode 100644 schemas/infra/opala/cron/v2.schema.json diff --git a/schemas/infra/opala/cron/v1.configs.json b/schemas/infra/opala/cron/v2.configs.json similarity index 82% rename from schemas/infra/opala/cron/v1.configs.json rename to schemas/infra/opala/cron/v2.configs.json index 7fbcf580..fa975e31 100644 --- a/schemas/infra/opala/cron/v1.configs.json +++ b/schemas/infra/opala/cron/v2.configs.json @@ -6,6 +6,9 @@ "logger": { "level": "info", "prettyPrint": false + }, + "tracing": { + "$ref": { "configName": "common-tracing", "version": "latest" } } }, "db": { diff --git a/schemas/infra/opala/cron/v2.schema.json b/schemas/infra/opala/cron/v2.schema.json new file mode 100644 index 00000000..c128e358 --- /dev/null +++ b/schemas/infra/opala/cron/v2.schema.json @@ -0,0 +1,101 @@ +{ + "$id": "https://mapcolonies.com/infra/opala/cron/v2", + "description": "The opala cron service schema", + "title": "opalaCronSchemaV2", + "type": "object", + "allOf": [ + { + "type": "object", + "required": ["telemetry", "cron", "db"], + "properties": { + "telemetry": { + "$ref": "#/definitions/telemetry" + }, + "db": { + "$ref": "https://mapcolonies.com/common/db/full/v1" + }, + "cron": { + "$ref": "#/definitions/crons" + } + } + } + ], + "definitions": { + "crons": { + "type": "object", + "additionalProperties": false, + "anyOf": [ + { + "required": ["np"] + }, + { + "required": ["stage"] + }, + { + "required": ["prod"] + } + ], + "properties": { + "np": { + "$ref": "#/definitions/cron" + }, + "prod": { + "$ref": "#/definitions/cron" + }, + "stage": { + "$ref": "#/definitions/cron" + } + } + }, + "cron": { + "type": "object", + "required": ["pattern", "s3"], + "properties": { + "pattern": { + "type": "string", + "description": "The cron timing spec", + "examples": ["*/1 * * * *"] + }, + "s3": { + "type": "object", + "allOf": [ + { + "$ref": "https://mapcolonies.com/common/s3/partial/v1" + }, + { + "type": "object", + "required": ["key", "bucket"], + "properties": { + "key": { + "type": "string", + "description": "specific key of bundle inside s3", + "x-env-value": "S3_KEY" + }, + "bucket": { + "type": "string", + "description": "specific bucket name inside s3", + "x-env-value": "S3_BUCKET" + } + } + } + ] + } + } + }, + "telemetry": { + "type": "object", + "required": ["logger"], + "properties": { + "logger": { + "$ref": "https://mapcolonies.com/common/telemetry/logger/v1" + }, + "tracing": { + "$ref": "https://mapcolonies.com/common/telemetry/tracing/v1" + }, + "shared": { + "$ref": "https://mapcolonies.com/common/telemetry/base/v1" + } + } + } + } +} From ad1ec26232ad2755462f2793c3a4b315cb1596c4 Mon Sep 17 00:00:00 2001 From: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com> Date: Sun, 4 May 2025 08:05:31 +0300 Subject: [PATCH 2/3] feat(opala): update telemetry schema to require tracing and shared properties --- schemas/infra/opala/cron/v2.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/schemas/infra/opala/cron/v2.schema.json b/schemas/infra/opala/cron/v2.schema.json index c128e358..d50aa1cd 100644 --- a/schemas/infra/opala/cron/v2.schema.json +++ b/schemas/infra/opala/cron/v2.schema.json @@ -84,7 +84,7 @@ }, "telemetry": { "type": "object", - "required": ["logger"], + "required": ["logger", "tracing", "shared"], "properties": { "logger": { "$ref": "https://mapcolonies.com/common/telemetry/logger/v1" From b155f01a534c1dc4190132ee589321ff58f52b76 Mon Sep 17 00:00:00 2001 From: CptSchnitz <12687466+CptSchnitz@users.noreply.github.com> Date: Sun, 4 May 2025 08:14:08 +0300 Subject: [PATCH 3/3] feat(opala): add shared properties to telemetry configuration --- schemas/infra/opala/cron/v2.configs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/schemas/infra/opala/cron/v2.configs.json b/schemas/infra/opala/cron/v2.configs.json index fa975e31..3d9abf84 100644 --- a/schemas/infra/opala/cron/v2.configs.json +++ b/schemas/infra/opala/cron/v2.configs.json @@ -9,7 +9,8 @@ }, "tracing": { "$ref": { "configName": "common-tracing", "version": "latest" } - } + }, + "shared": {} }, "db": { "$ref": { "configName": "infra-opala-db", "version": "latest" }