From 21fb3243651d644a4585253dd055e5b4e79626bd Mon Sep 17 00:00:00 2001 From: jamesbeedy Date: Thu, 27 Jun 2024 16:24:47 +0000 Subject: [PATCH] remove fluentbit and small fixes These changes remove the fluentbit relation and associated code and fix some leftover variable references. --- charmcraft.yaml | 2 - lib/charms/fluentbit/v0/fluentbit.py | 203 --------------------------- src/charm.py | 13 -- src/constants.py | 9 +- src/slurmdbd_ops.py | 101 ++++--------- 5 files changed, 38 insertions(+), 290 deletions(-) delete mode 100644 lib/charms/fluentbit/v0/fluentbit.py diff --git a/charmcraft.yaml b/charmcraft.yaml index 47e7e9f..a9cd3a3 100644 --- a/charmcraft.yaml +++ b/charmcraft.yaml @@ -28,8 +28,6 @@ links: requires: database: interface: mysql_client - fluentbit: - interface: fluentbit provides: slurmctld: diff --git a/lib/charms/fluentbit/v0/fluentbit.py b/lib/charms/fluentbit/v0/fluentbit.py deleted file mode 100644 index aa68450..0000000 --- a/lib/charms/fluentbit/v0/fluentbit.py +++ /dev/null @@ -1,203 +0,0 @@ -r"""Fluentbit charm libraries. - -This library contains two main classes: `FluentbitProvider` and -`FluentbitClient`. `FluentbitProvider` class is instantiated in the Fluentbit -Server charm, and receives configuration data through a relation to other -charms. `FluentbitClient` class should be instantiated in any charm that wants -to ship logs via Fluentbit. - -## Forwarding logs using Fluentbit - -To forward logs from your charm to a centralized place using Fluentbit, -instantiate the `FluentbitClient()` class and handle the `relation_created` -event in your main charm code. In this event, your charm must pass all the -configuration parameters necessary to configure Fluentbit: the inputs, the -parsers, and the filters. - -For example: - -```python -class MyCharm(CharmBase): - def __init__(self, *args): - super().__init__(*args) - - self._fluentbit = FluentbitClient(self, "fluentbit") - - self.framework.observe(self.on.fluentbit.relation_created, - self._fluentbit_relation_created) - - def _fluentbit_relation_created(self, event): - cfg = [{"input": [("name", "tail"), - ("path", "/var/log/foo/bar.log"), - ("path_key", "filename"), - ("tag", "foo"), - ("parser", "bar")]}, - {"parser": [("name", "bar"), - ("format", "regex"), - ("regex", "^\[(?