Alertmanager
- By Dylan Stephano-Shachter
Channel | Version | Revision | Published | Runs on |
---|---|---|---|---|
latest/stable | 47 | 47 | 31 Jan 2023 | |
latest/candidate | 47 | 47 | 31 Jan 2023 | |
latest/beta | 47 | 47 | 31 Jan 2023 | |
latest/edge | 51 | 51 | 02 Feb 2023 | |
1.0/stable | 47 | 47 | 31 Jan 2023 | |
1.0/candidate | 47 | 47 | 31 Jan 2023 | |
1.0/beta | 47 | 47 | 31 Jan 2023 | |
1.0/edge | 47 | 47 | 31 Jan 2023 |
juju deploy alertmanager-k8s
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
charms.alertmanager_k8s.v0.alertmanager_dispatch
-
- Last updated 22 Nov 2022
- Revision Library version 0
Alertmanager library.
This library is designed to be used by a charm consuming or providing the alertmanager_dispatch
relation interface.
This library is published as part of the Alertmanager charm.
You can file bugs here!
A typical example of including this library might be:
# ...
from charms.alertmanager_k8s.v0.alertmanager_dispatch import AlertmanagerConsumer
class SomeApplication(CharmBase):
def __init__(self, *args):
# ...
self.alertmanager_consumer = AlertmanagerConsumer(self, relation_name="alertmanager")
# ...
Index
class ClusterChanged
Event raised when an alertmanager cluster is changed.
Description
If an alertmanager unit is added to or removed from a relation, then a :class:`ClusterChanged` event should be emitted.
class AlertmanagerConsumerEvents
Description
Event descriptor for events raised by `AlertmanagerConsumer`. None
class RelationManagerBase
Base class that represents relation ends ("provides" and "requires").
Methods
RelationManagerBase. __init__( self , charm: CharmBase , relation_name: str , relation_role: RelationRole )
RelationManagerBase. _validate_relation( self , relation_name: str , relation_role: RelationRole )
class AlertmanagerConsumer
A "consumer" handler to be used by charms that relate to Alertmanager (the 'requires' side).
Arguments
Attributes
Description
To have your charm consume alertmanager cluster data, declare the interface's use in your charm's metadata.yaml file: ```yaml requires: alertmanager: interface: alertmanager_dispatch ``` A typical example of importing this library might be ```python from charms.alertmanager_k8s.v0.alertmanager_dispatch import AlertmanagerConsumer ``` In your charm's `__init__` method: ```python self.alertmanager_consumer = AlertmanagerConsumer(self, relation_name="alertmanager") ``` Every change in the alertmanager cluster emits a :class:`ClusterChanged` event that the consumer charm can register and handle, for example: ``` self.framework.observe(self.alertmanager_consumer.on.cluster_changed, self._on_alertmanager_cluster_changed) ``` The updated alertmanager cluster can then be obtained via the `get_cluster_info` method This consumer library expect the consumer charm to observe the `cluster_changed` event.
Methods
AlertmanagerConsumer. __init__( self , charm: CharmBase , relation_name: str )
AlertmanagerConsumer. _on_relation_changed( self , event )
Description
AlertmanagerConsumer. get_cluster_info( self )
Description
AlertmanagerConsumer. _on_relation_departed( self , _ )
Description
AlertmanagerConsumer. _on_relation_broken( self , _ )
Description
class AlertmanagerProvider
A "provider" handler to be used by charms that relate to Alertmanager (the 'provides' side).
Arguments
Attributes
Description
To have your charm provide alertmanager cluster data, declare the interface's use in your charm's metadata.yaml file: ```yaml provides: alerting: interface: alertmanager_dispatch ``` A typical example of importing this library might be ```python from charms.alertmanager_k8s.v0.alertmanager_dispatch import AlertmanagerProvider ``` In your charm's `__init__` method: ```python self.alertmanager_provider = AlertmanagerProvider(self, self._relation_name, self._api_port) ``` Then inform consumers on any update to alertmanager cluster data via ```python self.alertmanager_provider.update_relation_data() ``` This provider auto-registers relation events on behalf of the main Alertmanager charm.
Methods
AlertmanagerProvider. __init__( self , charm , relation_name: str , api_port: int )
AlertmanagerProvider. _on_relation_joined( self , event: RelationJoinedEvent )
This hook stores the public address of the newly-joined "alerting" relation.
Description
AlertmanagerProvider. _generate_relation_data( self , relation: Relation )
Helper function to generate relation data in the correct format.
Description
AlertmanagerProvider. update_relation_data( self , event )
Helper function for updating relation data bags.
Arguments
Description