feat(detectors/gcp): add parity for BMS, Cloud Run Worker Pool, GCE MIG, and GKE hostname - #9462
feat(detectors/gcp): add parity for BMS, Cloud Run Worker Pool, GCE MIG, and GKE hostname#9462dashpole wants to merge 13 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR extends detectors/gcp to match additional environment/resource-detection capabilities found in the Collector’s GCP resource detection, adding support for Bare Metal Solution (BMS) and Cloud Run Worker Pool parity, plus extra metadata on GCE and GKE.
Changes:
- Add Bare Metal Solution (BMS) detection and emit BMS-specific resource attributes.
- Treat
CloudRunWorkerPoolthe same asCloudRun, and add best-efforthost.nameenrichment for GKE nodes. - Detect and emit GCE Managed Instance Group (MIG) attributes on GCE.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| detectors/gcp/types.go | Extends the internal detector interface with MIG and BMS detection methods. |
| detectors/gcp/README.md | Documents BMS as a supported detection environment. |
| detectors/gcp/detector.go | Implements BMS short-circuit detection, Cloud Run Worker Pool handling, MIG attribute emission, and best-effort GKE hostname enrichment. |
| detectors/gcp/detector_test.go | Adds/extends unit tests covering MIG, Cloud Run Worker Pool, BMS, and GKE hostname behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #9462 +/- ##
=====================================
Coverage 84.5% 84.5%
=====================================
Files 203 203
Lines 16805 16828 +23
=====================================
+ Hits 14204 14225 +21
- Misses 2121 2123 +2
Partials 480 480
🚀 New features to boost your workflow:
|
338e8e2 to
6131435
Compare
|
Ah, I forgot that issue existed. Sorry for taking it without asking. |
|
I just need to add gcp.gce.instance.labels.* support, and move the library from opentelemetry-operations-go here. |
No issues :) |
091ecd6 to
6131435
Compare
I'll do those as follow-ups |
ps-mir
left a comment
There was a problem hiding this comment.
Comments on error handling and semconv helpers in tests.
6131435 to
e3989f3
Compare
ps-mir
left a comment
There was a problem hiding this comment.
Small concern on CloudPlatform() being called twice for detection.
…IG, and GKE hostname
e3989f3 to
147f2d6
Compare
Part of #8946
Description
Brings feature parity to
detectors/gcpto match the detector capabilities present inopentelemetry-collector-contrib's resourcedetectionprocessor:cloud.platform = "gcp_bare_metal_solution",cloud.account.id,host.name,cloud.region).CloudRunWorkerPoolidentically toCloudRun.gcp.gce.instance_group_manager.name,zone,region) on GCE.host.nameon GKE nodes when available.This is required for the collector to migrate to using this detector: open-telemetry/opentelemetry-collector-contrib#50211.