-
Notifications
You must be signed in to change notification settings - Fork 161
Allow defining extra resource labels in prometheus #1742
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
Conversation
marctc
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.
LGTM!
|
This PR must be merged before a backport PR will be created. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1742 +/- ##
==========================================
+ Coverage 65.84% 66.96% +1.12%
==========================================
Files 214 214
Lines 22225 22241 +16
==========================================
+ Hits 14634 14894 +260
+ Misses 6855 6609 -246
- Partials 736 738 +2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
rafaelroquetto
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.
Gnarly!
|
Merging due to some urgency from affected users. @grafsean feel free to suggest any correction to the docs and I'll address them in another PR before merging 2.0 backport. |
* Allow defining extra resource labels in prometheus * reformat (cherry picked from commit 7dbd664)
|
The backport to To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new branch
git switch --create backport-1742-to-release-2.0 origin/release-2.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x 7dbd6642d73037e08de54f4f44d2caf7731cdf68When the conflicts are resolved, stage and commit the changes: If you have the GitHub CLI installed: # Push the branch to GitHub:
git push --set-upstream origin backport-1742-to-release-2.0
# Create the PR body template
PR_BODY=$(gh pr view 1742 --json body --template 'Backport 7dbd6642d73037e08de54f4f44d2caf7731cdf68 from #1742{{ "\n\n---\n\n" }}{{ index . "body" }}')
# Create the PR on GitHub
echo "${PR_BODY}" | gh pr create --title '[release-2.0] Allow defining extra resource labels in prometheus' --body-file - --label 'type/docs' --label 'backport' --base release-2.0 --milestone release-2.0 --webOr, if you don't have the GitHub CLI installed (we recommend you install it!): # Push the branch to GitHub:
git push --set-upstream origin backport-1742-to-release-2.0
# Create a pull request where the `base` branch is `release-2.0` and the `compare`/`head` branch is `backport-1742-to-release-2.0`.
# Remove the local backport branch
git switch main
git branch -D backport-1742-to-release-2.0 |
* Allow defining extra resource labels in prometheus (#1742) * Allow defining extra resource labels in prometheus * reformat (cherry picked from commit 7dbd664) * Fix ebpf artifacts --------- Co-authored-by: Mario Macias <[email protected]>
Enables BEYLA_PROMETHEUS_EXTRA_RESOURCE_ATTRIBUTES to provide a list of additional resource attributes to be added to the reported
target_infometric, in Prometheus.Due to internal limitations of the Prometheus API client, Beyla needs to know beforehand which attributes are exposed
for each metric. This would cause that some attributes that are discovered at runtime, during instrumentation, won't
be visible by default. For example, attributes defined on each application via Kubernetes annotations, or in the
target application's
OTEL_RESOURCE_ATTRIBUTESenvironment variable.For example, an application defining the
OTEL_RESOURCE_ATTRIBUTES=deployment.environment=productionas environmentvariable, the
target_info{deployment.environment="production"}attribute would be visible by default if the metricsare exported via OpenTelemetry but not if they are exported via Prometheus.
To make
deployment_environmentvisible in Prometheus, you need to add it to theextra_resource_attributeslist.