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

Commit

Permalink
fix(schemas): Add new definitions in configs.json (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
hayk96 authored Dec 7, 2024
1 parent 94d3255 commit 6f65b9c
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.5.1 / 2024-12-07

* [BUGFIX] Fixed JSON schema validations for configuration management API. #59

## 0.5.0 / 2024-12-06

* [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
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: "3.5"
services:
prometheus:
image: prom/prometheus:v2.44.0
image: prom/prometheus:v3.0.0
container_name: prometheus
ports:
- "9090:9090"
Expand Down
58 changes: 45 additions & 13 deletions src/schemas/configs.json
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,30 @@
"type": ["string", "null"],
"enum": ["http", "https", null]
},
"enable_compression": {
"description": "If enable_compression is set to 'false, Prometheus will request uncompressed response from the scraped target.",
"type": "boolean",
"default": true
},
"enable_http2": {
"description": "Whether to enable HTTP2. Default is true.",
"type": "boolean",
"default": true
},
"track_timestamps_staleness": {
"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.",
"type": "boolean",
"default": false
},
"scrape_protocols": {
"description": "List of the protocols to negotiate during a scrape with the client.",
"type": ["array", "null"],
"items": {
"type": "string",
"description": "The protocols to negotiate during a scrape with the client.",
"enum": ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4", "PrometheusText1.0.0"]
}
},
"azure_sd_configs": {
"description": "List of Azure service discovery configurations.",
"type": ["array", "null"],
Expand Down Expand Up @@ -599,6 +623,9 @@
"authorization": {
"$ref": "#/definitions/authorization"
},
"enable_http2": {
"$ref": "#/definitions/enable_http2"
},
"oauth2": {
"$ref": "#/definitions/oauth2"
},
Expand Down Expand Up @@ -658,6 +685,9 @@
"authorization": {
"$ref": "#/definitions/authorization"
},
"enable_http2": {
"$ref": "#/definitions/enable_http2"
},
"oauth2": {
"$ref": "#/definitions/oauth2"
},
Expand Down Expand Up @@ -849,13 +879,7 @@
"default": "10s"
},
"scrape_protocols": {
"description": "List of the protocols to negotiate during a scrape with the client.",
"type": ["array", "null"],
"items": {
"type": "string",
"description": "The protocols to negotiate during a scrape with the client.",
"enum": ["PrometheusProto", "OpenMetricsText1.0.0", "OpenMetricsText0.0.1", "PrometheusText0.0.4"]
}
"$ref": "#/definitions/scrape_protocols"
},
"evaluation_interval": {
"$ref": "#/definitions/duration",
Expand Down Expand Up @@ -989,6 +1013,9 @@
"type": ["boolean", "null"],
"default": true
},
"enable_http2": {
"$ref": "#/definitions/enable_http2"
},
"queue_config": {
"description": "Configures the queue used to write to remote storage.",
"type": ["object", "null"],
Expand Down Expand Up @@ -1165,9 +1192,16 @@
"type": "string"
},
"enable_http2": {
"description": "Whether to enable HTTP2. Default is true.",
"type": "boolean",
"default": true
"$ref": "#/definitions/enable_http2"
},
"enable_compression": {
"$ref": "#/definitions/enable_compression"
},
"track_timestamps_staleness": {
"$ref": "#/definitions/track_timestamps_staleness"
},
"scrape_protocols": {
"$ref": "#/definitions/scrape_protocols"
},
"scrape_interval": {
"$ref": "#/definitions/duration",
Expand Down Expand Up @@ -1377,9 +1411,7 @@
"default": "10s"
},
"enable_http2": {
"description": "Whether to enable HTTP2. Default is true.",
"type": "boolean",
"default": true
"$ref": "#/definitions/enable_http2"
},
"api_version": {
"description": "The api version of Alertmanager.",
Expand Down
2 changes: 1 addition & 1 deletion src/utils/openapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def openapi(app: FastAPI):
"providing additional features and addressing its limitations. "
"Running as a sidecar alongside the Prometheus server enables "
"users to extend the capabilities of the API.",
version="0.5.0",
version="0.5.1",
contact={
"name": "Hayk Davtyan",
"url": "https://hayk96.github.io",
Expand Down

0 comments on commit 6f65b9c

Please sign in to comment.