Skip to content

Commit

Permalink
use faas.instance instead of faas.id in gcp detector
Browse files Browse the repository at this point in the history
  • Loading branch information
dashpole committed Aug 14, 2023
1 parent 63bc786 commit fa1143d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions detectors/gcp/detector.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,27 @@ func (d *detector) Detect(ctx context.Context) (*resource.Resource, error) {
b.attrs = append(b.attrs, semconv.CloudPlatformGCPCloudRun)
b.add(semconv.FaaSNameKey, d.detector.FaaSName)
b.add(semconv.FaaSVersionKey, d.detector.FaaSVersion)
b.add(semconv.FaaSIDKey, d.detector.FaaSID)
b.add(semconv.FaaSInstanceKey, d.detector.FaaSID)
b.add(semconv.CloudRegionKey, d.detector.FaaSCloudRegion)
case gcp.CloudFunctions:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPCloudFunctions)
b.add(semconv.FaaSNameKey, d.detector.FaaSName)
b.add(semconv.FaaSVersionKey, d.detector.FaaSVersion)
b.add(semconv.FaaSIDKey, d.detector.FaaSID)
b.add(semconv.FaaSInstanceKey, d.detector.FaaSID)
b.add(semconv.CloudRegionKey, d.detector.FaaSCloudRegion)
case gcp.AppEngineFlex:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPAppEngine)
b.addZoneAndRegion(d.detector.AppEngineFlexAvailabilityZoneAndRegion)
b.add(semconv.FaaSNameKey, d.detector.AppEngineServiceName)
b.add(semconv.FaaSVersionKey, d.detector.AppEngineServiceVersion)
b.add(semconv.FaaSIDKey, d.detector.AppEngineServiceInstance)
b.add(semconv.FaaSInstanceKey, d.detector.AppEngineServiceInstance)
case gcp.AppEngineStandard:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPAppEngine)
b.add(semconv.CloudAvailabilityZoneKey, d.detector.AppEngineStandardAvailabilityZone)
b.add(semconv.CloudRegionKey, d.detector.AppEngineStandardCloudRegion)
b.add(semconv.FaaSNameKey, d.detector.AppEngineServiceName)
b.add(semconv.FaaSVersionKey, d.detector.AppEngineServiceVersion)
b.add(semconv.FaaSIDKey, d.detector.AppEngineServiceInstance)
b.add(semconv.FaaSInstanceKey, d.detector.AppEngineServiceInstance)
case gcp.GCE:
b.attrs = append(b.attrs, semconv.CloudPlatformGCPComputeEngine)
b.addZoneAndRegion(d.detector.GCEAvailabilityZoneAndRegion)
Expand Down
8 changes: 4 additions & 4 deletions detectors/gcp/detector_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func TestDetect(t *testing.T) {
semconv.CloudRegion("us-central1"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -133,7 +133,7 @@ func TestDetect(t *testing.T) {
semconv.CloudRegion("us-central1"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -155,7 +155,7 @@ func TestDetect(t *testing.T) {
semconv.CloudAvailabilityZone("us-central1-c"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand All @@ -177,7 +177,7 @@ func TestDetect(t *testing.T) {
semconv.CloudAvailabilityZone("us-central1-c"),
semconv.FaaSName("my-service"),
semconv.FaaSVersion("123456"),
semconv.FaaSID("1472385723456792345"),
semconv.FaaSInstance("1472385723456792345"),
),
},
{
Expand Down

0 comments on commit fa1143d

Please sign in to comment.