vectordotdev / vectordotdev/vector
Find a better home for metrics tied to components' lifecycle
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 22.6k
- Forks
- 2.3k
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 146
Description
PR #25910 fixed vector_security_confinement_disabled expiring by storing Gauge handles in RunningTopology::sink_confinement_gauges. It works, but it's a band-aid:
RunningTopologynow has to know about a specific metric's lifecycle, which is the wrong layer of abstraction.- Any future one-shot build-time gauge would need the same treatment. Another field in RunningTopology and another ad-hock hook inside topology code.
The right fix is a general mechanism where a component can register a metric handle that is tied to its lifetime, without the topology needing to know what the handle is. Options worth exploring:
- A handle bag in
SinkContext(or a sharedComponentContext) that the topology drains and holds per component key. - A trait-level hook (e.g.
fn static_metric_handles(&self) -> Vec<Box<dyn Any>>) so the topology can hold arbitrary handles opaquely.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the lifecycle handling around RunningTopology::sink_confinement_gauges and the component context options named in the issue: SinkContext or ComponentContext. Compare a handle bag with the proposed trait-level hook, then determine how handles can be retained per component without topology-specific metric fields. Done means one general lifecycle mechanism replaces the current special case and supports future one-shot build-time gauges.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- observability
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100