From 3aeb08ffdfa57617a240561794391fda6fab80bc Mon Sep 17 00:00:00 2001 From: Karanraj Chauhan Date: Sat, 11 Apr 2026 00:34:40 -0400 Subject: [PATCH] Fix doc errors and inaccuracies. Fixes #275 --- docs/conf.py | 2 +- prometheus_api_client/metric_range_df.py | 2 +- prometheus_api_client/prometheus_connect.py | 14 +++++++------- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 95436d9..d925f37 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -200,7 +200,7 @@ # -- Options for intersphinx extension --------------------------------------- # Example configuration for intersphinx: refer to the Python standard library. -intersphinx_mapping = {"https://docs.python.org/": None} +intersphinx_mapping = {"python": ("https://docs.python.org/3", None)} # -- Options for todo extension ---------------------------------------------- diff --git a/prometheus_api_client/metric_range_df.py b/prometheus_api_client/metric_range_df.py index 3ec836f..10bc31a 100644 --- a/prometheus_api_client/metric_range_df.py +++ b/prometheus_api_client/metric_range_df.py @@ -42,7 +42,7 @@ class MetricRangeDataFrame(DataFrame): .. code-block:: python prom = PrometheusConnect() - metric_data = prom.get_current_metric_value(metric_name='up', label_config=my_label_config) + metric_data = prom.get_metric_range_data(metric_name='up', label_config=my_label_config) metric_df = MetricRangeDataFrame(metric_data) metric_df.head() ''' diff --git a/prometheus_api_client/prometheus_connect.py b/prometheus_api_client/prometheus_connect.py index 6f74939..74886fc 100644 --- a/prometheus_api_client/prometheus_connect.py +++ b/prometheus_api_client/prometheus_connect.py @@ -38,7 +38,7 @@ class PrometheusConnect: requests library auth parameter for further explanation. :param proxy: (Optional) Proxies dictionary to enable connection through proxy. Example: {"http_proxy": "", "https_proxy": ""} - :param session (Optional) Custom requests.Session to enable complex HTTP configuration + :param session: (Optional) Custom requests.Session to enable complex HTTP configuration :param timeout: (Optional) A timeout (in seconds) applied to all requests :param method: (Optional) (str) HTTP Method (GET or POST) to use for Query APIs that allow POST (/query, /query_range and /labels). Use POST for large and complex queries. Default is GET. @@ -444,8 +444,8 @@ def custom_query(self, query: str, params: dict = None, timeout: int = None): This method takes as input a string which will be sent as a query to the specified Prometheus Host. This query is a PromQL query. - :param query: (str) This is a PromQL query, a few examples can be found - at https://prometheus.io/docs/prometheus/latest/querying/examples/ + :param query: (str) This is a PromQL query, a few examples can be found at + `PromQL query examples `_ :param params: (dict) Optional dictionary containing GET parameters to be sent along with the API request, such as "time" :param timeout: (Optional) A timeout (in seconds) applied to the request @@ -487,8 +487,8 @@ def custom_query_range( This method takes as input a string which will be sent as a query to the specified Prometheus Host. This query is a PromQL query. - :param query: (str) This is a PromQL query, a few examples can be found - at https://prometheus.io/docs/prometheus/latest/querying/examples/ + :param query: (str) This is a PromQL query, a few examples can be found at + `PromQL query examples `_ :param start_time: (datetime) A datetime object that specifies the query range start time. :param end_time: (datetime) A datetime object that specifies the query range end time. :param step: (str) Query resolution step width in duration format or float number of seconds @@ -545,8 +545,8 @@ def get_metric_aggregation( The received query is passed to the custom_query_range method which returns the result of the query and the values are extracted from the result. - :param query: (str) This is a PromQL query, a few examples can be found - at https://prometheus.io/docs/prometheus/latest/querying/examples/ + :param query: (str) This is a PromQL query, a few examples can be found at + `PromQL query examples `_ :param operations: (list) A list of operations to perform on the values. Operations are specified in string type. :param start_time: (datetime) A datetime object that specifies the query range start time.