From 9ed4d5c7d39b3b763359a030b4e7964a836ce881 Mon Sep 17 00:00:00 2001 From: michael Date: Fri, 8 Nov 2024 13:36:28 +0200 Subject: [PATCH] refactor --- src/cosl/coordinated_workers/coordinator.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cosl/coordinated_workers/coordinator.py b/src/cosl/coordinated_workers/coordinator.py index a486e96..eaac18b 100644 --- a/src/cosl/coordinated_workers/coordinator.py +++ b/src/cosl/coordinated_workers/coordinator.py @@ -216,7 +216,7 @@ def __init__( is_coherent: Custom coherency checker for a minimal deployment. is_recommended: Custom coherency checker for a recommended deployment. tracing_receivers: A dictionary of receivers and their corresponding endpoints to which the worker's workload can push traces to. - If not provided, endpoints acquired from "tracing" relation would be used. + If not provided, endpoints acquired from "tracing" relation would be used if any. resources_limit_options: A dictionary containing resources limit option names. The dictionary should include "cpu_limit" and "memory_limit" keys with values as option names, as defined in the config.yaml. If no dictionary is provided, the default option names "cpu_limit" and "memory_limit" would be used. @@ -257,6 +257,7 @@ def __init__( self._container_name = container_name self._resources_limit_options = resources_limit_options or {} self.remote_write_endpoints_getter = remote_write_endpoints + self._tracing_receivers = tracing_receivers self.nginx = Nginx( self._charm, @@ -304,7 +305,6 @@ def __init__( relation_name=self._endpoints["tracing"], protocols=["otlp_http", "jaeger_thrift_http"], ) - self._tracing_receivers = tracing_receivers or self._tracing_receivers_urls() # Resources patch self.resources_patch = ( @@ -671,7 +671,7 @@ def update_cluster(self): privkey_secret_id=( self.cluster.grant_privkey(VAULT_SECRET_LABEL) if self.tls_available else None ), - tracing_receivers=self._tracing_receivers, + tracing_receivers=self._tracing_receivers or self._tracing_receivers_urls(), remote_write_endpoints=( self.remote_write_endpoints_getter() if self.remote_write_endpoints_getter