remove labelstore from prometheus interceptor#4890
Conversation
a27d37a to
83fb65a
Compare
| "github.com/grafana/alloy/syntax" | ||
| ) | ||
|
|
||
| func TestRelabelThroughAppend(t *testing.T) { |
There was a problem hiding this comment.
This is covered through the relabel pipeline test
ptodev
left a comment
There was a problem hiding this comment.
I'm not super familiar with the label store, but on a high level this change makes sense. I'm just not sure why the Fanout is a better place for a cache than Interceptor? In theory should the Interceptor be better, since it's the entry point to a component?
CHANGELOG.md
Outdated
|
|
||
| - Add `meta_cache_address` to `beyla.ebpf` component. (@skl) | ||
|
|
||
| - Remove labelstore interactions from the prometheus interceptor simplifying prometheus pipelines. (@kgeckhart) |
There was a problem hiding this comment.
Does this change really need a changelog entry? It is more like an internal refinment that doesn't impact users.
There was a problem hiding this comment.
🤷 it's an optimization on a highly used pipeline
There was a problem hiding this comment.
The issue is that the entry does say how the change impacts end users. If it's an optimisation I'd expect it to say something like "improved the CPU performance of prometheus.* components".
It's a good question that I didn't expand upon in the PR. I added a comment to Fanout to indicate it's role with global series refs and updated the PR description with the further context about why Fanout. |
ptodev
left a comment
There was a problem hiding this comment.
Thank you, LGTM but I think the changelog entry could be more clear.
CHANGELOG.md
Outdated
|
|
||
| - Add `meta_cache_address` to `beyla.ebpf` component. (@skl) | ||
|
|
||
| - Remove labelstore interactions from the prometheus interceptor simplifying prometheus pipelines. (@kgeckhart) |
There was a problem hiding this comment.
The issue is that the entry does say how the change impacts end users. If it's an optimisation I'd expect it to say something like "improved the CPU performance of prometheus.* components".
a351863 to
bfac704
Compare
* Add some high level pipeline tests for prometheus * Remove labelstore interactions from the interceptor * Move back to uber atomic and fix flaky remote write test * One more thing to move back to uber atomic * Actually fix the flaky test and lints * Fix flaky test for real and add a comment to Fanout about its role in global labels * Put componentID back on fanout for now
* Add some high level pipeline tests for prometheus * Remove labelstore interactions from the interceptor * Move back to uber atomic and fix flaky remote write test * One more thing to move back to uber atomic * Actually fix the flaky test and lints * Fix flaky test for real and add a comment to Fanout about its role in global labels * Put componentID back on fanout for now
PR Description
Removes unnecessary usage of labelstore from the prometheus.interceptor used in prometheus pipelines.
Beyond simplifying the code there's a performance gain from the reduction in duplicate staleness tracking through the labelstore,
The results were generated through the "headless" prometheus pipeline tests I added to track end-to-end scenarios related to WAL functionality that will be important as the labelstore continues to evolve.
Notes to the Reviewer
Fanout is the appender that must be used to emit metrics from any alloy component as it's what ensures we can multi-cast metrics to downstream consumers. The interceptor is used by most components that emit metrics but it is not a requirement, enrich + relabel use it to run their functionality, and scrape uses it to support livedebugging but it's not used by receive_http, otelcol.exporter.prometheus, and the operator which all use Fanout directly. Since any component that needs to emit metrics uses Fanout it makes the most sense to put logic there to enforce emitted metrics have a valid global seriesRef / are properly tracked for staleness.
PR Checklist