Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LogForwarder to coordinator #90

Merged
merged 5 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "cosl"
version = "0.0.40"
version = "0.0.41"
authors = [
{ name="sed-i", email="[email protected]" },
]
Expand Down
7 changes: 4 additions & 3 deletions src/cosl/coordinated_workers/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,21 +47,21 @@
"charms.observability_libs.v1.cert_handler",
"charms.prometheus_k8s.v0.prometheus_scrape",
"charms.loki_k8s.v1.loki_push_api",
"charms.tempo_k8s.v2.tracing",
"charms.tempo_coordinator_k8s.v0.tracing",
"charms.observability_libs.v0.kubernetes_compute_resources_patch",
"charms.tls_certificates_interface.v3.tls_certificates",
)

from charms.data_platform_libs.v0.s3 import S3Requirer
from charms.grafana_k8s.v0.grafana_dashboard import GrafanaDashboardProvider
from charms.loki_k8s.v1.loki_push_api import LokiPushApiConsumer
from charms.loki_k8s.v1.loki_push_api import LogForwarder, LokiPushApiConsumer
from charms.observability_libs.v0.kubernetes_compute_resources_patch import (
KubernetesComputeResourcesPatch,
adjust_resource_requirements,
)
from charms.observability_libs.v1.cert_handler import VAULT_SECRET_LABEL, CertHandler
from charms.prometheus_k8s.v0.prometheus_scrape import MetricsEndpointProvider
from charms.tempo_k8s.v2.tracing import TracingEndpointRequirer
from charms.tempo_coordinator_k8s.v0.tracing import TracingEndpointRequirer
from lightkube.models.core_v1 import ResourceRequirements

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -283,6 +283,7 @@ def __init__(
)

self._logging = LokiPushApiConsumer(self._charm, relation_name=self._endpoints["logging"])
self._log_forwarder = LogForwarder(self._charm, relation_name=self._endpoints["logging"])

# Provide ability for this to be scraped by Prometheus using prometheus_scrape
refresh_events = [self._charm.on.update_status, self.cluster.on.changed]
Expand Down
4 changes: 2 additions & 2 deletions src/cosl/coordinated_workers/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,8 @@ def charm_tracing_config(self) -> Tuple[Optional[str], Optional[str]]:
Usage:
assuming you are using charm_tracing >= v1.9:
>>> from ops import CharmBase
>>> from lib.charms.tempo_k8s.v1.charm_tracing import trace_charm
>>> from lib.charms.tempo_k8s.v2.tracing import charm_tracing_config
>>> from lib.charms.tempo_coordinator_k8s.v0.charm_tracing import trace_charm
>>> from lib.charms.tempo_coordinator_k8s.v0.tracing import charm_tracing_config
>>> @trace_charm(tracing_endpoint="my_endpoint", cert_path="cert_path")
>>> class MyCharm(CharmBase):
>>> def __init__(self, ...):
Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ commands =
charmcraft fetch-lib charms.observability_libs.v1.cert_handler
charmcraft fetch-lib charms.prometheus_k8s.v0.prometheus_scrape
charmcraft fetch-lib charms.loki_k8s.v1.loki_push_api
charmcraft fetch-lib charms.tempo_k8s.v2.tracing
charmcraft fetch-lib charms.tempo_coordinator_k8s.v0.tracing
charmcraft fetch-lib charms.observability_libs.v0.kubernetes_compute_resources_patch
charmcraft fetch-lib charms.tls_certificates_interface.v3.tls_certificates

Expand Down
Loading