-
Notifications
You must be signed in to change notification settings - Fork 492
remove labelstore from prometheus interceptor #4890
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
base: main
Are you sure you want to change the base?
Conversation
50b5eca to
a27d37a
Compare
a27d37a to
83fb65a
Compare
| "github.com/grafana/alloy/syntax" | ||
| ) | ||
|
|
||
| func TestRelabelThroughAppend(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is covered through the relabel pipeline test
ptodev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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?
|
|
||
| - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤷 it's an optimization on a highly used pipeline
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM but I think the changelog entry could be more clear.
|
|
||
| - 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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".
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