Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation Broken: get_metric_aggregation and MetricRangeDataFrame #275

Open
miah0x41 opened this issue Dec 30, 2023 · 1 comment
Open

Comments

@miah0x41
Copy link

The formatting of the documentation for the function get_metric_aggregation appears to be broken as ilustrated below:

image

The description for the parameter query contains a link, which I suspect is causing the issue but I am unable to build the documentation to verify myself.

I think these are the responsible lines:
https://github.com/4n4nd/prometheus-api-client-python/blob/49362b07cb3bec835a8211d81becd5ed205ace18/prometheus_api_client/prometheus_connect.py#L466C1-L467C77

    :param query: (str) This is a PromQL query, a few examples can be found
          at https://prometheus.io/docs/prometheus/latest/querying/examples/

The link formatting for rst should be I believe:

    :param query: (str) This is a PromQL query, a few examples can be found
          at `https://prometheus.io/docs/prometheus/latest/querying/examples/ <https://prometheus.io/docs/prometheus/latest/querying/examples/>`_

Please note the use of single ` to surround the link text and link itself. Also the addition of <> to surround the link itself and followed by a trailing _.

I would be happy to make the necessary amendments but would need some guidance on how to build the docs.

@miah0x41 miah0x41 changed the title Documentation Broken: get_metric_aggregation Documentation Broken: get_metric_aggregation and MetricRangeDataFrame Dec 30, 2023
@miah0x41
Copy link
Author

Updated title to reflect another bug:

image

Link to documentation: here.

The key snippet of code is:

metric_data = prom.get_current_metric_value(metric_name='up', label_config=my_label_config)
metric_df = MetricRangeDataFrame(metric_data)

However MetricRangeDataFrame only works on ranges and therefore prom.get_current_metric_value is the wrong function, should be I think: get_metric_range_data (well possibly).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant