Skip to content

Commit

Permalink
chore: update charm libraries (#302)
Browse files Browse the repository at this point in the history
  • Loading branch information
maas-lander authored Dec 19, 2024
1 parent 7d92c92 commit 472da9e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions maas-region/lib/charms/tempo_coordinator_k8s/v0/tracing.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def __init__(self, *args):

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

PYDEPS = ["pydantic"]

Expand Down Expand Up @@ -891,13 +891,15 @@ def _get_endpoint(
filter(lambda i: i.protocol.name == protocol, app_data.receivers)
)
if not receivers:
logger.error(f"no receiver found with protocol={protocol!r}")
# it can happen if the charm requests tracing protocols, but the relay (such as grafana-agent) isn't yet
# connected to the tracing backend. In this case, it's not an error the charm author can do anything about
logger.warning(f"no receiver found with protocol={protocol!r}.")
return
if len(receivers) > 1:
logger.error(
# if we have more than 1 receiver that matches, it shouldn't matter which receiver we'll be using.
logger.warning(
f"too many receivers with protocol={protocol!r}; using first one. Found: {receivers}"
)
return

receiver = receivers[0]
return receiver.url
Expand Down

0 comments on commit 472da9e

Please sign in to comment.