canonical / canonical/cos-proxy-operator

Vector binary is started conditionally, so it should stop conditionally also

Open
#216 0 comments 0 reactions 0 assignees View on GitHub
Priority: Low Status: Triage Type: Enhancement
Dominant language
Python
Stars
3
Forks
12
PR merge metrics
No merged PRs in 30d

Description

### Enhancement Proposal

We run `self._start_vector()` when the following relations join:
1. filebeat
2. general-info
3. monitors

This means we have to conditionally set up scrape jobs depending on the existence of Vector. However, Vector remains running unless we stop the charm. I am not sure the reason this design was implemented, but it seems wrong. We could add logic to stop vector when those relations do not exist, and then check for the status of Vector with:

```python
def _is_vector_running(self) -> bool:
return service_running("vector")
```

This is relevant in the `COSProxyCharm._on_nrpe_targets_changed` method, since the Vector scrape job is defined here.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at COSProxyCharm._on_nrpe_targets_changed and trace _start_vector alongside the filebeat, general-info, and monitors relation handlers. Check how service_running("vector") is used, then verify that Vector stops when none of those relations exist and remains running when at least one does.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
infrastructure
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.