Skip to content
This repository was archived by the owner on Jan 13, 2025. It is now read-only.

Commit 6f65b9c

Browse files
authored
fix(schemas): Add new definitions in configs.json (#59)
1 parent 94d3255 commit 6f65b9c

File tree

4 files changed

+51
-15
lines changed

4 files changed

+51
-15
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 0.5.1 / 2024-12-07
4+
5+
* [BUGFIX] Fixed JSON schema validations for configuration management API. #59
6+
37
## 0.5.0 / 2024-12-06
48

59
* [REFACTOR] Created a `PrometheusAPIClient` class for core API functionalities such as creating/deleting rule files and updating/reloading configurations. Removed a duplicated validation function and moved it to the utils folder. Also Updated the architecture diagram. #53

docs/examples/docker/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: "3.5"
22
services:
33
prometheus:
4-
image: prom/prometheus:v2.44.0
4+
image: prom/prometheus:v3.0.0
55
container_name: prometheus
66
ports:
77
- "9090:9090"

src/schemas/configs.json

Lines changed: 45 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -447,6 +447,30 @@
447447
"type": ["string", "null"],
448448
"enum": ["http", "https", null]
449449
},
450+
"enable_compression": {
451+
"description": "If enable_compression is set to 'false, Prometheus will request uncompressed response from the scraped target.",
452+
"type": "boolean",
453+
"default": true
454+
},
455+
"enable_http2": {
456+
"description": "Whether to enable HTTP2. Default is true.",
457+
"type": "boolean",
458+
"default": true
459+
},
460+
"track_timestamps_staleness": {
461+
"description": "Controls whether Prometheus tracks staleness of the metrics that have an explicit timestamps present in scraped data. If track_timestamps_staleness is set to 'true', a staleness marker will be inserted in the TSDB when a metric is no longer present or the target is down.",
462+
"type": "boolean",
463+
"default": false
464+
},
465+
"scrape_protocols": {
466+
"description": "List of the protocols to negotiate during a scrape with the client.",
467+
"type": ["array", "null"],
468+
"items": {
469+
"type": "string",
470+
"description": "The protocols to negotiate during a scrape with the client.",
471+
"enum": ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4", "PrometheusText1.0.0"]
472+
}
473+
},
450474
"azure_sd_configs": {
451475
"description": "List of Azure service discovery configurations.",
452476
"type": ["array", "null"],
@@ -599,6 +623,9 @@
599623
"authorization": {
600624
"$ref": "#/definitions/authorization"
601625
},
626+
"enable_http2": {
627+
"$ref": "#/definitions/enable_http2"
628+
},
602629
"oauth2": {
603630
"$ref": "#/definitions/oauth2"
604631
},
@@ -658,6 +685,9 @@
658685
"authorization": {
659686
"$ref": "#/definitions/authorization"
660687
},
688+
"enable_http2": {
689+
"$ref": "#/definitions/enable_http2"
690+
},
661691
"oauth2": {
662692
"$ref": "#/definitions/oauth2"
663693
},
@@ -849,13 +879,7 @@
849879
"default": "10s"
850880
},
851881
"scrape_protocols": {
852-
"description": "List of the protocols to negotiate during a scrape with the client.",
853-
"type": ["array", "null"],
854-
"items": {
855-
"type": "string",
856-
"description": "The protocols to negotiate during a scrape with the client.",
857-
"enum": ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
858-
}
882+
"$ref": "#/definitions/scrape_protocols"
859883
},
860884
"evaluation_interval": {
861885
"$ref": "#/definitions/duration",
@@ -989,6 +1013,9 @@
9891013
"type": ["boolean", "null"],
9901014
"default": true
9911015
},
1016+
"enable_http2": {
1017+
"$ref": "#/definitions/enable_http2"
1018+
},
9921019
"queue_config": {
9931020
"description": "Configures the queue used to write to remote storage.",
9941021
"type": ["object", "null"],
@@ -1165,9 +1192,16 @@
11651192
"type": "string"
11661193
},
11671194
"enable_http2": {
1168-
"description": "Whether to enable HTTP2. Default is true.",
1169-
"type": "boolean",
1170-
"default": true
1195+
"$ref": "#/definitions/enable_http2"
1196+
},
1197+
"enable_compression": {
1198+
"$ref": "#/definitions/enable_compression"
1199+
},
1200+
"track_timestamps_staleness": {
1201+
"$ref": "#/definitions/track_timestamps_staleness"
1202+
},
1203+
"scrape_protocols": {
1204+
"$ref": "#/definitions/scrape_protocols"
11711205
},
11721206
"scrape_interval": {
11731207
"$ref": "#/definitions/duration",
@@ -1377,9 +1411,7 @@
13771411
"default": "10s"
13781412
},
13791413
"enable_http2": {
1380-
"description": "Whether to enable HTTP2. Default is true.",
1381-
"type": "boolean",
1382-
"default": true
1414+
"$ref": "#/definitions/enable_http2"
13831415
},
13841416
"api_version": {
13851417
"description": "The api version of Alertmanager.",

src/utils/openapi.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def openapi(app: FastAPI):
1616
"providing additional features and addressing its limitations. "
1717
"Running as a sidecar alongside the Prometheus server enables "
1818
"users to extend the capabilities of the API.",
19-
version="0.5.0",
19+
version="0.5.1",
2020
contact={
2121
"name": "Hayk Davtyan",
2222
"url": "https://hayk96.github.io",

0 commit comments

Comments
 (0)