Skip to content

Commit

Permalink
chore: update charm libraries (#45)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] authored Jul 28, 2023
1 parent 7b82432 commit 4d35fec
Showing 1 changed file with 13 additions and 14 deletions.
27 changes: 13 additions & 14 deletions lib/charms/loki_k8s/v0/loki_push_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,21 +67,20 @@ class LokiOperatorCharm(CharmBase):
def __init__(self, *args):
super().__init__(*args)
...
self._loki_ready()
external_url = urlparse(self._external_url)
self.loki_provider = LokiPushApiProvider(
self,
address=external_url.hostname or self.hostname,
port=external_url.port or 80,
scheme=external_url.scheme,
path=f"{external_url.path}/loki/api/v1/push",
)
...
def _loki_ready(self):
try:
version = self._loki_server.version
self.loki_provider = LokiPushApiProvider(self)
logger.debug("Loki Provider is available. Loki version: %s", version)
except LokiServerNotReadyError as e:
self.unit.status = MaintenanceStatus(str(e))
except LokiServerError as e:
self.unit.status = BlockedStatus(str(e))
- `port`: Loki Push Api endpoint port. Default value: 3100.
- `rules_dir`: Directory to store alert rules. Default value: "/loki/rules".
- `port`: Loki Push Api endpoint port. Default value: `3100`.
- `scheme`: Loki Push Api endpoint scheme (`HTTP` or `HTTPS`). Default value: `HTTP`
- `address`: Loki Push Api endpoint address. Default value: `localhost`
- `path`: Loki Push Api endpoint path. Default value: `loki/api/v1/push`
The `LokiPushApiProvider` object has several responsibilities:
Expand Down Expand Up @@ -481,7 +480,7 @@ def _alert_rules_error(self, event):

# Increment this PATCH version before using `charmcraft publish-lib` or reset
# to 0 if you are raising the major API version
LIBPATCH = 19
LIBPATCH = 20

logger = logging.getLogger(__name__)

Expand Down

0 comments on commit 4d35fec

Please sign in to comment.