canonical / canonical/cos-coordinated-workers
Coordinator is using 2 different logging wrappers on the same relation endpoint
- Dominant language
- Python
- Stars
- 1
- Forks
- 2
- PR merge metrics
- No merged PRs in 30d
Description
### Enhancement Proposal
Currently, the coordinator is using `LokiPushApiConsumer` to pass the Loki endpoints to a worker that, which in turn, grabs those endpoints and forwards its logs using a [ManualLogForwarder](https://github.com/canonical/cos-coordinated-workers/blob/main/src/coordinated_workers/worker.py#L887).
Then, to forward the coordinator's own workload logs, we instantiate yet another logging wrapper `LogForwarder` on the same relation endpoint.
No issues were reported as a side-effect from this implementation (till now), but one side-effect is that each consumer class (`LokiPushApiConsumer` and `LogForwarder`) overwrites the same relation databag with the same set of alert rules causing unnecessary databag updates.
Proposal: Use `ManualLogForwarder` to forward the coordinator workload logs and avoid any databag updates that come with using `LogForwarder`.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start in src/coordinated_workers/worker.py around the ManualLogForwarder definition at line 887, then trace the coordinator's LogForwarder setup and the LokiPushApiConsumer usage described in the issue. Replace the coordinator-side wrapper with the manual forwarder while preserving log forwarding and avoiding duplicate alert-rule databag updates; verify with the project's existing checks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100