Skip to content

Commit 7048563

Browse files
refactor: constrain editorTag per connection type with per-type enum definitions
- Move editorTag from global definition to per-connection-type definitions - Add editorTagLensesHq, editorTagKafka, editorTagZookeeper, editorTagConnect, editorTagSchemaRegistry, editorTagAws, editorTagWebhook, editorTagDatadog, editorTagPagerduty, editorTagSlack, editorTagSplunk, editorTagAlertmanager - Each connection type now validates editorTag values specific to that connection - Property name remains 'editorTag' across all connections - Ensures schema validation of editorTag values by connection type
1 parent 2613469 commit 7048563

File tree

2 files changed

+118
-71
lines changed

2 files changed

+118
-71
lines changed

agent/provisioning.schema-6.1.json

Lines changed: 114 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -906,6 +906,107 @@
906906
},
907907
"title": "LensesHQ Max Jitter Window Milliseconds",
908908
"description": "The maximum duration of jitter window in milliseconds for retries in communication with the LensesHQ server."
909+
},
910+
"editorTagLensesHq": {
911+
"type": "string",
912+
"title": "Editor Tag",
913+
"description": "Editor tag for Lenses UX (Lenses HQ connection).",
914+
"enum": ["Lenses HQ", "Lenses HQ TLS"]
915+
},
916+
"editorTagKafka": {
917+
"type": "string",
918+
"title": "Editor Tag",
919+
"description": "Editor tag for Lenses UX (Kafka connection).",
920+
"enum": [
921+
"Aiven",
922+
"AWS MSK, SSL/TLS",
923+
"AWS MSK, mutal SSL/TLS",
924+
"AWS MSK, IAM",
925+
"Azure Eventhubs",
926+
"Confluent Cloud, SASL_SSL, PLAIN",
927+
"IBM Event Streams",
928+
"Redpanda",
929+
"PLAINTEXT",
930+
"SASL_PLAINTEXT, PLAIN",
931+
"SASL_PLAINTEXT, SCRAM-SHA-256",
932+
"SASL_PLAINTEXT, SCRAM-SHA-512",
933+
"SASL_SSL, PLAIN",
934+
"SASL_SSL, SCRAM-SHA-256",
935+
"SASL_SSL, SCRAM-SHA-512",
936+
"SSL/TLS",
937+
"Mutual SSL/TLS"
938+
]
939+
},
940+
"editorTagZookeeper": {
941+
"type": "string",
942+
"title": "Editor Tag",
943+
"description": "Editor tag for Lenses UX (Zookeeper connection).",
944+
"enum": ["Zookeeper"]
945+
},
946+
"editorTagConnect": {
947+
"type": "string",
948+
"title": "Editor Tag",
949+
"description": "Editor tag for Lenses UX (Kafka Connect connection).",
950+
"enum": ["No Auth", "HTTP Basic Auth", "HTTP Basic Auth, SSL/TLS", "HTTP Basic Auth, Mutual SSL/TLS"]
951+
},
952+
"editorTagSchemaRegistry": {
953+
"type": "string",
954+
"title": "Editor Tag",
955+
"description": "Editor tag for Lenses UX (Schema Registry connection).",
956+
"enum": [
957+
"Confluent No Auth",
958+
"Confluent Basic Auth",
959+
"Confluent Basic Auth, SSL/TLS",
960+
"Confluent Basic Auth, Mutual SSL/TLS",
961+
"Aiven (Karpace)",
962+
"AWS Glue (Access Keys)",
963+
"AWS Glue (Credentials chain)",
964+
"AWS Glue (Assume Role)",
965+
"IBM Event Streams Registry",
966+
"ApiCurio"
967+
]
968+
},
969+
"editorTagAws": {
970+
"type": "string",
971+
"title": "Editor Tag",
972+
"description": "Editor tag for Lenses UX (AWS connection).",
973+
"enum": ["AWS Connection for Glue & CloudWatch"]
974+
},
975+
"editorTagWebhook": {
976+
"type": "string",
977+
"title": "Editor Tag",
978+
"description": "Editor tag for Lenses UX (Webhook connection).",
979+
"enum": ["Webhook"]
980+
},
981+
"editorTagDatadog": {
982+
"type": "string",
983+
"title": "Editor Tag",
984+
"description": "Editor tag for Lenses UX (DataDog connection).",
985+
"enum": ["DataDog"]
986+
},
987+
"editorTagPagerduty": {
988+
"type": "string",
989+
"title": "Editor Tag",
990+
"description": "Editor tag for Lenses UX (PagerDuty connection).",
991+
"enum": ["PagerDuty"]
992+
},
993+
"editorTagSlack": {
994+
"type": "string",
995+
"title": "Editor Tag",
996+
"description": "Editor tag for Lenses UX (Slack connection).",
997+
"enum": ["Slack"]
998+
},
999+
"editorTagSplunk": {
1000+
"type": "string",
1001+
"title": "Editor Tag",
1002+
"description": "Editor tag for Lenses UX (Splunk connection).",
1003+
"enum": ["Splunk"]
1004+
},
1005+
"editorTagAlertmanager": {
1006+
"type": "string",
1007+
"title": "Editor Tag",
1008+
"description": "Editor tag for Lenses UX (Alert Manager connection).",
1009+
"enum": ["Alert Manager"]
9091010
}
9101011
},
9111012
"properties": {
@@ -922,7 +1023,7 @@
9221023
"enum": ["lenses-hq"],
9231024
"default": "lenses-hq"
9241025
},
925-
"editorTag": { "$ref": "#/definitions/editorTag" },
1026+
"editorTag": { "$ref": "#/definitions/editorTagLensesHq" },
9261027
"version": { "$ref": "#/definitions/version" },
9271028
"tags": { "$ref": "#/definitions/tags" },
9281029
"configuration": {
@@ -972,7 +1073,7 @@
9721073
"enum": ["kafka"],
9731074
"default": "kafka"
9741075
},
975-
"editorTag": { "$ref": "#/definitions/editorTag" },
1076+
"editorTag": { "$ref": "#/definitions/editorTagKafka" },
9761077
"version": { "$ref": "#/definitions/version" },
9771078
"tags": { "$ref": "#/definitions/tags" },
9781079
"configuration": {
@@ -1220,7 +1321,7 @@
12201321
"enum": ["zookeeper"],
12211322
"default": "zookeeper"
12221323
},
1223-
"editorTag": { "$ref": "#/definitions/editorTag" },
1324+
"editorTag": { "$ref": "#/definitions/editorTagZookeeper" },
12241325
"version": { "$ref": "#/definitions/version" },
12251326
"tags": { "$ref": "#/definitions/tags" },
12261327
"configuration": {
@@ -1278,7 +1379,7 @@
12781379
"enum": ["schema-registry"],
12791380
"default": "schema-registry"
12801381
},
1281-
"editorTag": { "$ref": "#/definitions/editorTag" },
1382+
"editorTag": { "$ref": "#/definitions/editorTagSchemaRegistry" },
12821383
"version": { "$ref": "#/definitions/version" },
12831384
"tags": { "$ref": "#/definitions/tags" },
12841385
"configuration": {
@@ -1436,7 +1537,7 @@
14361537
"enum": ["schema-registry"],
14371538
"default": "schema-registry"
14381539
},
1439-
"editorTag": { "$ref": "#/definitions/editorTag" },
1540+
"editorTag": { "$ref": "#/definitions/editorTagSchemaRegistry" },
14401541
"version": { "$ref": "#/definitions/version" },
14411542
"tags": { "$ref": "#/definitions/tags" },
14421543
"configuration": {
@@ -1481,7 +1582,7 @@
14811582
"pattern": "^[a-zA-Z0-9-]+$",
14821583
"default": "connect"
14831584
},
1484-
"editorTag": { "$ref": "#/definitions/editorTag" },
1585+
"editorTag": { "$ref": "#/definitions/editorTagConnect" },
14851586
"version": { "$ref": "#/definitions/version" },
14861587
"tags": { "$ref": "#/definitions/tags" },
14871588
"configuration": {
@@ -1612,7 +1713,7 @@
16121713
"pattern": "^[a-zA-Z0-9-]+$",
16131714
"default": "aws"
16141715
},
1615-
"editorTag": { "$ref": "#/definitions/editorTag" },
1716+
"editorTag": { "$ref": "#/definitions/editorTagAws" },
16161717
"version": { "$ref": "#/definitions/version" },
16171718
"tags": { "$ref": "#/definitions/tags" },
16181719
"configuration": {
@@ -1648,7 +1749,7 @@
16481749
"pattern": "^[a-zA-Z0-9-]+$",
16491750
"default": "webhook"
16501751
},
1651-
"editorTag": { "$ref": "#/definitions/editorTag" },
1752+
"editorTag": { "$ref": "#/definitions/editorTagWebhook" },
16521753
"version": { "$ref": "#/definitions/version" },
16531754
"tags": { "$ref": "#/definitions/tags" },
16541755
"configuration": {
@@ -1679,7 +1780,7 @@
16791780
"pattern": "^[a-zA-Z0-9-]+$",
16801781
"default": "datadog"
16811782
},
1682-
"editorTag": { "$ref": "#/definitions/editorTag" },
1783+
"editorTag": { "$ref": "#/definitions/editorTagDatadog" },
16831784
"version": { "$ref": "#/definitions/version" },
16841785
"tags": { "$ref": "#/definitions/tags" },
16851786
"configuration": {
@@ -1708,7 +1809,7 @@
17081809
"pattern": "^[a-zA-Z0-9-]+$",
17091810
"default": "pagerduty"
17101811
},
1711-
"editorTag": { "$ref": "#/definitions/editorTag" },
1812+
"editorTag": { "$ref": "#/definitions/editorTagPagerduty" },
17121813
"version": { "$ref": "#/definitions/version" },
17131814
"tags": { "$ref": "#/definitions/tags" },
17141815
"configuration": {
@@ -1735,7 +1836,7 @@
17351836
"pattern": "^[a-zA-Z0-9-]+$",
17361837
"default": "slack"
17371838
},
1738-
"editorTag": { "$ref": "#/definitions/editorTag" },
1839+
"editorTag": { "$ref": "#/definitions/editorTagSlack" },
17391840
"version": { "$ref": "#/definitions/version" },
17401841
"tags": { "$ref": "#/definitions/tags" },
17411842
"configuration": {
@@ -1763,7 +1864,7 @@
17631864
"pattern": "^[a-zA-Z0-9-]+$",
17641865
"default": "splunk"
17651866
},
1766-
"editorTag": { "$ref": "#/definitions/editorTag" },
1867+
"editorTag": { "$ref": "#/definitions/editorTagSplunk" },
17671868
"version": { "$ref": "#/definitions/version" },
17681869
"tags": { "$ref": "#/definitions/tags" },
17691870
"configuration": {
@@ -1794,7 +1895,7 @@
17941895
"pattern": "^[a-zA-Z0-9-]+$",
17951896
"default": "my-alertmanager-connection"
17961897
},
1797-
"editorTag": { "$ref": "#/definitions/editorTag" },
1898+
"editorTag": { "$ref": "#/definitions/editorTagAlertmanager" },
17981899
"version": { "$ref": "#/definitions/version" },
17991900
"tags": { "$ref": "#/definitions/tags" },
18001901
"configuration": {

example.provisioning.yaml

Lines changed: 4 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,14 @@
1-
# yaml-language-server: $schema=./agent/provisioning.schema.json
1+
# yaml-language-server: #$schema=./agent/provisioning.schema-6.1.json
22

3-
# Lenses Agent Provisioning Configuration
4-
# This file uses the local JSON schema for validation and autocompletion
5-
6-
# Example configuration structure - uncomment and modify as needed:
7-
8-
lensesHq:
9-
- name: "lenses-hq"
10-
version: 1
11-
tags:
12-
- "hq"
13-
configuration:
14-
server:
15-
value: "<YOUR LENSES HQ SERVER URL>"
16-
port:
17-
value: 10000
18-
agentKey:
19-
value: "<LENSES_HQ_AGENT_KEY>"
203

214
kafka:
22-
- name: "kafka"
5+
- name: kafka
236
version: 1
24-
tags: []
7+
editorTag:
258
configuration:
269
kafkaBootstrapServers:
2710
value:
28-
- "PLAINTEXT://demo-kafka:9092"
29-
protocol:
30-
value: "PLAINTEXT"
31-
# Uncomment below to enable JMX metrics:
32-
# metricsPort:
33-
# value: 9581
34-
# metricsType:
35-
# value: "JMX"
36-
# metricsSsl:
37-
# value: false
38-
# metricsUsername:
39-
# value: "jmxuser"
40-
# metricsPassword:
41-
# value: "jmxpass"
11+
-
4212

43-
zookeeper:
44-
- name: "zookeeper"
45-
version: 1
46-
tags: []
47-
configuration:
48-
zookeeperUrls:
49-
value:
50-
- "localhost:2181"
5113

52-
connect:
53-
- name: "connect"
54-
version: 1
55-
tags: []
56-
configuration:
57-
workers:
58-
value:
59-
- "http://localhost:8083"
6014

61-
confluentSchemaRegistry:
62-
- name: "schema-registry"
63-
version: 1
64-
tags: []
65-
configuration:
66-
schemaRegistryUrls:
67-
value:
68-
- "http://localhost:8081"

0 commit comments

Comments
 (0)