Skip to content
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

Use only the required informers #1210

Merged
merged 2 commits into from
Oct 1, 2024
Merged

Conversation

mariomac
Copy link
Contributor

@mariomac mariomac commented Oct 1, 2024

Based on top of Marc's PR: https://github.com/grafana/beyla/pull/1209/files

It would narrow the scope of the informers:

  • If network metrics are active, it would setup all the informers for cluster-wide resources.
  • If only application metrics are active, it would only activate the Pod informer, for the node local pods.

Addresses #1198 and #824

@codecov-commenter
Copy link

codecov-commenter commented Oct 1, 2024

Codecov Report

Attention: Patch coverage is 62.96296% with 20 lines in your changes missing coverage. Please review.

Project coverage is 81.68%. Comparing base (91f8aeb) to head (1764d6d).

Files with missing lines Patch % Lines
pkg/internal/kube/informer_provider.go 51.85% 6 Missing and 7 partials ⚠️
pkg/internal/pipe/global/host_id.go 12.50% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1210      +/-   ##
==========================================
- Coverage   81.88%   81.68%   -0.21%     
==========================================
  Files         137      137              
  Lines       11450    11475      +25     
==========================================
- Hits         9376     9373       -3     
- Misses       1543     1562      +19     
- Partials      531      540       +9     
Flag Coverage Δ
integration-test 60.36% <3.70%> (-0.66%) ⬇️
k8s-integration-test 58.19% <61.11%> (-0.37%) ⬇️
oats-test 36.08% <3.70%> (-0.07%) ⬇️
unittests 53.00% <22.22%> (-0.10%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

informerFactory = informers.NewSharedInformerFactory(client, resyncTime)
} else {
fieldSelector := fields.OneTermEqualSelector("spec.nodeName", restrictNode).String()
k.log.Info("using field selector", "selector", fieldSelector)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we want to keep that as info? or debug would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are right. Moving to debug would have more sense

Copy link
Contributor

@marctc marctc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, this will make Beyla much more efficient in large clusters!

@mariomac mariomac merged commit 4c93dcd into grafana:main Oct 1, 2024
10 checks passed
@mariomac mariomac deleted the restrict-informers branch October 1, 2024 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants