[processor/resourcedetection] support instance labels into GCP resourcedetection processor#41919
Merged
ChrsMark merged 50 commits intoopen-telemetry:mainfrom Feb 3, 2026
Merged
Conversation
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Contributor
|
@braydonk @ridwanmsharif @psx95 @quentinmit |
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Merged
3 tasks
Member
Author
|
/label -stale never-stale |
…-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Member
Author
|
@dashpole, can you please take a look at this and let me know if it makes sense to support it? I can resolve the conflicts after it. Otherwise, maybe makes sense to close the issue as not planned 🙏 But sincerely, I see value in this. I personally use the |
dashpole
approved these changes
Feb 2, 2026
…-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Member
Author
|
/rerun |
…-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
…lector-contrib into feat/35859 Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
ajimenez1503
pushed a commit
to ajimenez1503/opentelemetry-collector-contrib
that referenced
this pull request
Feb 4, 2026
…cedetection processor (open-telemetry#41919) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description This change adds support for detecting Google Compute Engine (GCE) instance labels and including them as resource attributes in the same way AWS EC2 and Azure detectors already do. When running on GCE, the resource detection processor can now fetch instance labels from the Compute API (if label key regex patterns are configured) and attach them to the emitted resource under the gce.labels.* namespace. While implementing this, I considered splitting the GCE-specific detection logic into its own dedicated package (similar to the existing AWS EC2 detector structure) to improve maintainability. This could be addressed in a follow-up PR if the team agrees it’s worthwhile. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue Fixes open-telemetry#35859 <!--Describe what testing was performed and which tests were added.--> #### Testing I have updated the tests to cover this case, but if you would like additional real evidence (logs, etc), please let me know. <!--Describe the documentation added.--> #### Documentation Updated the README.md with the permissions needed for this feature work and an example. <!--Please delete paragraphs that you did not use before submitting.--> --------- Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
mx-psi
pushed a commit
that referenced
this pull request
Feb 4, 2026
…ease GCE labels test coverage (#45852) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description After my PR #41919 was merged, I feel some improvements could be made related to it. This PR does not change any behaviour for the users and includes the following changes: - Un-export `GCElabelPrefix` renaming it to `gceLabelPrefix` - Update log format when reading metadata for labels fails - Increase test coverage, including using invalid regex patterns --------- Signed-off-by: Paulo Dias <paulodias.gm@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This change adds support for detecting Google Compute Engine (GCE) instance labels and including them as resource attributes in the same way AWS EC2 and Azure detectors already do.
When running on GCE, the resource detection processor can now fetch instance labels from the Compute API (if label key regex patterns are configured) and attach them to the emitted resource under the gce.labels.* namespace.
While implementing this, I considered splitting the GCE-specific detection logic into its own dedicated package (similar to the existing AWS EC2 detector structure) to improve maintainability. This could be addressed in a follow-up PR if the team agrees it’s worthwhile.
Link to tracking issue
Fixes #35859
Testing
I have updated the tests to cover this case, but if you would like additional real evidence (logs, etc), please let me know.
Documentation
Updated the README.md with the permissions needed for this feature work and an example.