Skip to content

Commit

Permalink
Add docstrings
Browse files Browse the repository at this point in the history
  • Loading branch information
mateoflorido committed Oct 30, 2023
1 parent 8314beb commit a97e6e7
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/cos_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,34 @@

@dataclass
class JobConfig:
"""Data class representing the configuration for a Prometheus scrape job.
Attributes:
name (str): The name of the scrape job. Corresponds to the name of the Kubernetes
component being monitored (e.g., 'kube-apiserver').
metrics_path (str): The endpoint path where the metrics are exposed by the
component (e.g., '/metrics').
scheme (str): The scheme used for the endpoint. (e.g.'http' or 'https').
target (str): The network address of the target component along with the port.
Format is 'hostname:port' (e.g., 'localhost:6443').
"""

name: str
metrics_path: str
scheme: str
target: str


class COSIntegration:
"""Utility class that handles the integration with COS for Charmed Kubernetes.
This class provides methods to retrieve and configure Prometheus metrics scraping endpoints
based on the Kubernetes components running within the cluster.
Attributes:
charm (CharmBase): Reference to the base charm instance.
"""

def __init__(self, charm: KubernetesControlPlaneCharm) -> None:
self.charm = charm

Expand Down

0 comments on commit a97e6e7

Please sign in to comment.