Skip to content

Support Monitor Client and Fetch Entity Metrics #569

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

Open
wants to merge 7 commits into
base: dev
Choose a base branch
from

Conversation

yec-akamai
Copy link
Contributor

@yec-akamai yec-akamai commented Jul 10, 2025

📝 Description

This PR introduced a new client MonitorClient, to make calls to a different host monitor-api. Also refactor the LinodeClient and have them share a BaseClient. The endpoint for this client is fetching metrics for a list of entities. Also, updated test suite for the new client and test the fetching metrics endpoint.

✔️ How to Test

Unit test:

make test-unit

@yec-akamai yec-akamai changed the title init Support Monitor Client and Fetch Entity Metrics Jul 10, 2025
@yec-akamai yec-akamai marked this pull request as ready for review July 15, 2025 13:40
@yec-akamai yec-akamai requested a review from a team as a code owner July 15, 2025 13:40
@yec-akamai yec-akamai requested review from jriddle-linode and zliang-akamai and removed request for a team July 15, 2025 13:40
@yec-akamai yec-akamai added new-feature for new features in the changelog. do-not-merge PRs that should not be merged until the commented issue is resolved labels Jul 15, 2025
Comment on lines -67 to -102
"""
The main interface to the Linode API.

:param token: The authentication token to use for communication with the
API. Can be either a Personal Access Token or an OAuth Token.
:type token: str
:param base_url: The base URL for API requests. Generally, you shouldn't
change this.
:type base_url: str
:param user_agent: What to append to the User Agent of all requests made
by this client. Setting this allows Linode's internal
monitoring applications to track the usage of your
application. Setting this is not necessary, but some
applications may desire this behavior.
:type user_agent: str
:param page_size: The default size to request pages at. If not given,
the API's default page size is used. Valid values
can be found in the API docs, but at time of writing
are between 25 and 500.
:type page_size: int
:param retry: Whether API requests should automatically be retries on known
intermittent responses.
:type retry: bool
:param retry_rate_limit_interval: The amount of time to wait between HTTP request
retries.
:type retry_rate_limit_interval: Union[float, int]
:param retry_max: The number of request retries that should be attempted before
raising an API error.
:type retry_max: int
:type retry_statuses: List of int
:param retry_statuses: Additional HTTP response statuses to retry on.
By default, the client will retry on 408, 429, and 502
responses.
:param ca_path: The path to a CA file to use for API requests in this client.
:type ca_path: str
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we keep some doc strings for the BaseClient as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
do-not-merge PRs that should not be merged until the commented issue is resolved new-feature for new features in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants