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

Add support for pod matching based on labels #694

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

msvechla
Copy link
Contributor

This change adds a new selector property k8s_pod_labels to the services configuration. This selector property will limit the instrumentation to the applications running in the Pods having labels with matching keys and values.

Addresses #691

Please let me know what you think and whether we can improve the implementation.

@CLAassistant
Copy link

CLAassistant commented Mar 22, 2024

CLA assistant check
All committers have signed the CLA.

@mariomac mariomac requested a review from grafsean March 25, 2024 09:50
@codecov-commenter
Copy link

codecov-commenter commented Mar 25, 2024

Codecov Report

Attention: Patch coverage is 70.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 33.52%. Comparing base (933917a) to head (18e8cc4).
Report is 2 commits behind head on main.

Files Patch % Lines
pkg/internal/discover/matcher.go 62.50% 4 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main     #694       +/-   ##
===========================================
- Coverage   76.86%   33.52%   -43.34%     
===========================================
  Files          97      124       +27     
  Lines        8008     9288     +1280     
===========================================
- Hits         6155     3114     -3041     
- Misses       1512     5995     +4483     
+ Partials      341      179      -162     
Flag Coverage Δ
integration-test ?
unittests 33.52% <70.00%> (-5.89%) ⬇️

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.

Copy link
Contributor

@mariomac mariomac left a comment

Choose a reason for hiding this comment

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

Amazing! Tank you for your valuable contribution.

The code is clean and tests are correct.

There are just a couple of minor issues in the documentation. Will wait for them to be addressed, plus an approval from our docs team before merging.

docs/sources/configure/options.md Outdated Show resolved Hide resolved
docs/sources/configure/options.md Show resolved Hide resolved
Copy link
Contributor

@grafsean grafsean left a comment

Choose a reason for hiding this comment

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

Looks good with the Vale fixes suggested.

This change adds a new selector property `k8s_pod_labels` to the
services configuration. This selector property will limit the
instrumentation to the applications running in the Pods having labels
with keys matching the provided value as regular expression.
@msvechla msvechla requested a review from grafsean March 25, 2024 14:58
@mariomac mariomac merged commit 14b4a5f into grafana:main Mar 25, 2024
6 checks passed
mattdurham pushed a commit to mattdurham/beyla that referenced this pull request Jan 22, 2025
* Add support for pod matching based on labels

This change adds a new selector property `k8s_pod_labels` to the
services configuration. This selector property will limit the
instrumentation to the applications running in the Pods having labels
with keys matching the provided value as regular expression.

* lint: rename Env var to Environment variable as recommended by Vale
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.

5 participants