diff --git a/.chloggen/gcp-faas-instance.yaml b/.chloggen/gcp-faas-instance.yaml new file mode 100644 index 000000000000..fb7ba053ced2 --- /dev/null +++ b/.chloggen/gcp-faas-instance.yaml @@ -0,0 +1,27 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: 'deprecation' + +# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver) +component: resourcedetectionprocessor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Detect faas.instance in the gcp detector, and deprecate detecting faas.id in the gcp detector. + +# Mandatory: One or more tracking issues related to the change. You can use the PR number here if no issue exists. +issues: [26486] + +# (Optional) One or more lines of additional information to render under the primary note. +# These lines will be padded with 2 spaces and then inserted directly into the document. +# Use pipe (|) for multiline entries. +subtext: faas.id has been removed from the semantic conventions. + +# If your change doesn't affect end users or the exported elements of any package, +# you should instead start your pull request title with [chore] or use the "Skip Changelog" label. +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [user] diff --git a/processor/resourcedetectionprocessor/go.mod b/processor/resourcedetectionprocessor/go.mod index 57ffadf15912..8697fa2f2696 100644 --- a/processor/resourcedetectionprocessor/go.mod +++ b/processor/resourcedetectionprocessor/go.mod @@ -9,6 +9,7 @@ require ( github.com/google/go-cmp v0.5.9 github.com/hashicorp/consul/api v1.25.1 github.com/open-telemetry/opentelemetry-collector-contrib/internal/aws/ecsutil v0.86.1-0.20231004185026-b5635a7a90d2 + github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.86.1-0.20231004185026-b5635a7a90d2 github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.86.1-0.20231004185026-b5635a7a90d2 github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.86.1-0.20231004185026-b5635a7a90d2 github.com/shirou/gopsutil/v3 v3.23.9 @@ -19,6 +20,7 @@ require ( go.opentelemetry.io/collector/config/configtls v0.86.1-0.20231004185026-b5635a7a90d2 go.opentelemetry.io/collector/confmap v0.86.1-0.20231004185026-b5635a7a90d2 go.opentelemetry.io/collector/consumer v0.86.1-0.20231004185026-b5635a7a90d2 + go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231004185026-b5635a7a90d2 go.opentelemetry.io/collector/pdata v1.0.0-rcv0015.0.20231004185026-b5635a7a90d2 go.opentelemetry.io/collector/processor v0.86.1-0.20231004185026-b5635a7a90d2 go.opentelemetry.io/collector/semconv v0.86.1-0.20231004185026-b5635a7a90d2 @@ -79,7 +81,6 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect - github.com/open-telemetry/opentelemetry-collector-contrib/internal/common v0.86.1-0.20231004185026-b5635a7a90d2 // indirect github.com/opencontainers/go-digest v1.0.0 // indirect github.com/opencontainers/image-spec v1.0.2 // indirect github.com/openshift/api v3.9.0+incompatible // indirect @@ -102,7 +103,6 @@ require ( go.opentelemetry.io/collector/config/internal v0.86.1-0.20231004185026-b5635a7a90d2 // indirect go.opentelemetry.io/collector/extension v0.86.1-0.20231004185026-b5635a7a90d2 // indirect go.opentelemetry.io/collector/extension/auth v0.86.1-0.20231004185026-b5635a7a90d2 // indirect - go.opentelemetry.io/collector/featuregate v1.0.0-rcv0015.0.20231004185026-b5635a7a90d2 // indirect go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.45.0 // indirect go.opentelemetry.io/otel v1.19.0 // indirect go.opentelemetry.io/otel/metric v1.19.0 // indirect diff --git a/processor/resourcedetectionprocessor/internal/gcp/gcp.go b/processor/resourcedetectionprocessor/internal/gcp/gcp.go index c1e7d74184c9..e2ed72483f92 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/gcp.go +++ b/processor/resourcedetectionprocessor/internal/gcp/gcp.go @@ -8,6 +8,7 @@ import ( "cloud.google.com/go/compute/metadata" "github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp" + "go.opentelemetry.io/collector/featuregate" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/processor" conventions "go.opentelemetry.io/collector/semconv/v1.6.1" @@ -23,6 +24,12 @@ const ( TypeStr = "gcp" ) +var removeGCPFaasID = featuregate.GlobalRegistry().MustRegister( + "processor.resourcedetection.removeGCPFaasID", + featuregate.StageAlpha, + featuregate.WithRegisterDescription("Remove faas.id from the GCP detector. Use faas.instance instead."), + featuregate.WithRegisterFromVersion("v0.87.0")) + // NewDetector returns a detector which can detect resource attributes on: // * Google Compute Engine (GCE). // * Google Kubernetes Engine (GKE). @@ -72,43 +79,58 @@ func (d *detector) Detect(context.Context) (resource pcommon.Resource, schemaURL errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasName, d.detector.FaaSName), d.rb.SetFromCallable(d.rb.SetFaasVersion, d.detector.FaaSVersion), - d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID), + d.rb.SetFromCallable(d.rb.SetFaasInstance, d.detector.FaaSID), d.rb.SetFromCallable(d.rb.SetCloudRegion, d.detector.FaaSCloudRegion), ) + if !removeGCPFaasID.IsEnabled() { + errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID)) + } case gcp.CloudRunJob: d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformGCPCloudRun) errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasName, d.detector.FaaSName), d.rb.SetFromCallable(d.rb.SetCloudRegion, d.detector.FaaSCloudRegion), - d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID), + d.rb.SetFromCallable(d.rb.SetFaasInstance, d.detector.FaaSID), d.rb.SetFromCallable(d.rb.SetGcpCloudRunJobExecution, d.detector.CloudRunJobExecution), d.rb.SetFromCallable(d.rb.SetGcpCloudRunJobTaskIndex, d.detector.CloudRunJobTaskIndex), ) + if !removeGCPFaasID.IsEnabled() { + errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID)) + } case gcp.CloudFunctions: d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformGCPCloudFunctions) errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasName, d.detector.FaaSName), d.rb.SetFromCallable(d.rb.SetFaasVersion, d.detector.FaaSVersion), - d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID), + d.rb.SetFromCallable(d.rb.SetFaasInstance, d.detector.FaaSID), d.rb.SetFromCallable(d.rb.SetCloudRegion, d.detector.FaaSCloudRegion), ) + if !removeGCPFaasID.IsEnabled() { + errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.FaaSID)) + } case gcp.AppEngineFlex: d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformGCPAppEngine) errs = multierr.Combine(errs, d.rb.SetZoneAndRegion(d.detector.AppEngineFlexAvailabilityZoneAndRegion), d.rb.SetFromCallable(d.rb.SetFaasName, d.detector.AppEngineServiceName), d.rb.SetFromCallable(d.rb.SetFaasVersion, d.detector.AppEngineServiceVersion), - d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.AppEngineServiceInstance), + d.rb.SetFromCallable(d.rb.SetFaasInstance, d.detector.AppEngineServiceInstance), ) + if !removeGCPFaasID.IsEnabled() { + errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.AppEngineServiceInstance)) + } case gcp.AppEngineStandard: d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformGCPAppEngine) errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasName, d.detector.AppEngineServiceName), d.rb.SetFromCallable(d.rb.SetFaasVersion, d.detector.AppEngineServiceVersion), - d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.AppEngineServiceInstance), + d.rb.SetFromCallable(d.rb.SetFaasInstance, d.detector.AppEngineServiceInstance), d.rb.SetFromCallable(d.rb.SetCloudAvailabilityZone, d.detector.AppEngineStandardAvailabilityZone), d.rb.SetFromCallable(d.rb.SetCloudRegion, d.detector.AppEngineStandardCloudRegion), ) + if !removeGCPFaasID.IsEnabled() { + errs = multierr.Combine(errs, d.rb.SetFromCallable(d.rb.SetFaasID, d.detector.AppEngineServiceInstance)) + } case gcp.GCE: d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformGCPComputeEngine) errs = multierr.Combine(errs, diff --git a/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go b/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go index 906dcebe7b2e..3dce53426e8b 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go +++ b/processor/resourcedetectionprocessor/internal/gcp/gcp_test.go @@ -13,6 +13,7 @@ import ( conventions "go.opentelemetry.io/collector/semconv/v1.6.1" "go.uber.org/zap" + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/common/testutil" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal" localMetadata "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal/gcp/internal/metadata" ) @@ -26,6 +27,7 @@ func TestDetect(t *testing.T) { detector internal.Detector expectErr bool expectedResource map[string]any + addFaasID bool }{ { desc: "zonal GKE cluster", @@ -156,8 +158,30 @@ func TestDetect(t *testing.T) { conventions.AttributeCloudRegion: "us-central1", conventions.AttributeFaaSName: "my-service", conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", + }, + }, + { + desc: "Cloud Run with feature gate disabled", + detector: newTestDetector(&fakeGCPDetector{ + projectID: "my-project", + cloudPlatform: gcp.CloudRun, + faaSID: "1472385723456792345", + faaSCloudRegion: "us-central1", + faaSName: "my-service", + faaSVersion: "123456", + }), + expectedResource: map[string]any{ + conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP, + conventions.AttributeCloudAccountID: "my-project", + conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPCloudRun, + conventions.AttributeCloudRegion: "us-central1", + conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", conventions.AttributeFaaSID: "1472385723456792345", }, + addFaasID: true, }, { desc: "Cloud Run Job", @@ -176,10 +200,34 @@ func TestDetect(t *testing.T) { conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPCloudRun, conventions.AttributeCloudRegion: "us-central1", conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSInstance: "1472385723456792345", + "gcp.cloud_run.job.execution": "my-service-ajg89", + "gcp.cloud_run.job.task_index": "2", + }, + }, + { + desc: "Cloud Run Job with feature gate disabled", + detector: newTestDetector(&fakeGCPDetector{ + projectID: "my-project", + cloudPlatform: gcp.CloudRunJob, + faaSID: "1472385723456792345", + faaSCloudRegion: "us-central1", + faaSName: "my-service", + gcpCloudRunJobExecution: "my-service-ajg89", + gcpCloudRunJobTaskIndex: "2", + }), + expectedResource: map[string]any{ + conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP, + conventions.AttributeCloudAccountID: "my-project", + conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPCloudRun, + conventions.AttributeCloudRegion: "us-central1", + conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSInstance: "1472385723456792345", conventions.AttributeFaaSID: "1472385723456792345", "gcp.cloud_run.job.execution": "my-service-ajg89", "gcp.cloud_run.job.task_index": "2", }, + addFaasID: true, }, { desc: "Cloud Functions", @@ -198,8 +246,30 @@ func TestDetect(t *testing.T) { conventions.AttributeCloudRegion: "us-central1", conventions.AttributeFaaSName: "my-service", conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", + }, + }, + { + desc: "Cloud Functions with feature gate disabled", + detector: newTestDetector(&fakeGCPDetector{ + projectID: "my-project", + cloudPlatform: gcp.CloudFunctions, + faaSID: "1472385723456792345", + faaSCloudRegion: "us-central1", + faaSName: "my-service", + faaSVersion: "123456", + }), + expectedResource: map[string]any{ + conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP, + conventions.AttributeCloudAccountID: "my-project", + conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPCloudFunctions, + conventions.AttributeCloudRegion: "us-central1", + conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", conventions.AttributeFaaSID: "1472385723456792345", }, + addFaasID: true, }, { desc: "App Engine Standard", @@ -220,8 +290,32 @@ func TestDetect(t *testing.T) { conventions.AttributeCloudAvailabilityZone: "us-central1-c", conventions.AttributeFaaSName: "my-service", conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", + }, + }, + { + desc: "App Engine Standard with feature gate disabled", + detector: newTestDetector(&fakeGCPDetector{ + projectID: "my-project", + cloudPlatform: gcp.AppEngineStandard, + appEngineServiceInstance: "1472385723456792345", + appEngineAvailabilityZone: "us-central1-c", + appEngineRegion: "us-central1", + appEngineServiceName: "my-service", + appEngineServiceVersion: "123456", + }), + expectedResource: map[string]any{ + conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP, + conventions.AttributeCloudAccountID: "my-project", + conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPAppEngine, + conventions.AttributeCloudRegion: "us-central1", + conventions.AttributeCloudAvailabilityZone: "us-central1-c", + conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", conventions.AttributeFaaSID: "1472385723456792345", }, + addFaasID: true, }, { desc: "App Engine Flex", @@ -242,8 +336,32 @@ func TestDetect(t *testing.T) { conventions.AttributeCloudAvailabilityZone: "us-central1-c", conventions.AttributeFaaSName: "my-service", conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", + }, + }, + { + desc: "App Engine Flex with feature gate disabled", + detector: newTestDetector(&fakeGCPDetector{ + projectID: "my-project", + cloudPlatform: gcp.AppEngineFlex, + appEngineServiceInstance: "1472385723456792345", + appEngineAvailabilityZone: "us-central1-c", + appEngineRegion: "us-central1", + appEngineServiceName: "my-service", + appEngineServiceVersion: "123456", + }), + expectedResource: map[string]any{ + conventions.AttributeCloudProvider: conventions.AttributeCloudProviderGCP, + conventions.AttributeCloudAccountID: "my-project", + conventions.AttributeCloudPlatform: conventions.AttributeCloudPlatformGCPAppEngine, + conventions.AttributeCloudRegion: "us-central1", + conventions.AttributeCloudAvailabilityZone: "us-central1-c", + conventions.AttributeFaaSName: "my-service", + conventions.AttributeFaaSVersion: "123456", + conventions.AttributeFaaSInstance: "1472385723456792345", conventions.AttributeFaaSID: "1472385723456792345", }, + addFaasID: true, }, { desc: "Unknown Platform", @@ -268,6 +386,7 @@ func TestDetect(t *testing.T) { }, } { t.Run(tc.desc, func(t *testing.T) { + defer testutil.SetFeatureGateForTest(t, removeGCPFaasID, !tc.addFaasID)() res, schema, err := tc.detector.Detect(context.TODO()) if tc.expectErr { assert.Error(t, err) diff --git a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config.go b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config.go index 732dff567288..b54064817018 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config.go +++ b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config.go @@ -15,6 +15,7 @@ type ResourceAttributesConfig struct { CloudProvider ResourceAttributeConfig `mapstructure:"cloud.provider"` CloudRegion ResourceAttributeConfig `mapstructure:"cloud.region"` FaasID ResourceAttributeConfig `mapstructure:"faas.id"` + FaasInstance ResourceAttributeConfig `mapstructure:"faas.instance"` FaasName ResourceAttributeConfig `mapstructure:"faas.name"` FaasVersion ResourceAttributeConfig `mapstructure:"faas.version"` GcpCloudRunJobExecution ResourceAttributeConfig `mapstructure:"gcp.cloud_run.job.execution"` @@ -47,6 +48,9 @@ func DefaultResourceAttributesConfig() ResourceAttributesConfig { FaasID: ResourceAttributeConfig{ Enabled: true, }, + FaasInstance: ResourceAttributeConfig{ + Enabled: true, + }, FaasName: ResourceAttributeConfig{ Enabled: true, }, diff --git a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config_test.go b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config_test.go index 463c4a40d572..a98ec6fff5b6 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config_test.go +++ b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_config_test.go @@ -31,6 +31,7 @@ func TestResourceAttributesConfig(t *testing.T) { CloudProvider: ResourceAttributeConfig{Enabled: true}, CloudRegion: ResourceAttributeConfig{Enabled: true}, FaasID: ResourceAttributeConfig{Enabled: true}, + FaasInstance: ResourceAttributeConfig{Enabled: true}, FaasName: ResourceAttributeConfig{Enabled: true}, FaasVersion: ResourceAttributeConfig{Enabled: true}, GcpCloudRunJobExecution: ResourceAttributeConfig{Enabled: true}, @@ -52,6 +53,7 @@ func TestResourceAttributesConfig(t *testing.T) { CloudProvider: ResourceAttributeConfig{Enabled: false}, CloudRegion: ResourceAttributeConfig{Enabled: false}, FaasID: ResourceAttributeConfig{Enabled: false}, + FaasInstance: ResourceAttributeConfig{Enabled: false}, FaasName: ResourceAttributeConfig{Enabled: false}, FaasVersion: ResourceAttributeConfig{Enabled: false}, GcpCloudRunJobExecution: ResourceAttributeConfig{Enabled: false}, diff --git a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource.go b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource.go index 6059deb79488..acd1aab7c307 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource.go +++ b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource.go @@ -63,6 +63,13 @@ func (rb *ResourceBuilder) SetFaasID(val string) { } } +// SetFaasInstance sets provided value as "faas.instance" attribute. +func (rb *ResourceBuilder) SetFaasInstance(val string) { + if rb.config.FaasInstance.Enabled { + rb.res.Attributes().PutStr("faas.instance", val) + } +} + // SetFaasName sets provided value as "faas.name" attribute. func (rb *ResourceBuilder) SetFaasName(val string) { if rb.config.FaasName.Enabled { diff --git a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource_test.go b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource_test.go index 40cde6496465..f0d207c3a0d0 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource_test.go +++ b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/generated_resource_test.go @@ -19,6 +19,7 @@ func TestResourceBuilder(t *testing.T) { rb.SetCloudProvider("cloud.provider-val") rb.SetCloudRegion("cloud.region-val") rb.SetFaasID("faas.id-val") + rb.SetFaasInstance("faas.instance-val") rb.SetFaasName("faas.name-val") rb.SetFaasVersion("faas.version-val") rb.SetGcpCloudRunJobExecution("gcp.cloud_run.job.execution-val") @@ -35,9 +36,9 @@ func TestResourceBuilder(t *testing.T) { switch test { case "default": - assert.Equal(t, 14, res.Attributes().Len()) + assert.Equal(t, 15, res.Attributes().Len()) case "all_set": - assert.Equal(t, 16, res.Attributes().Len()) + assert.Equal(t, 17, res.Attributes().Len()) case "none_set": assert.Equal(t, 0, res.Attributes().Len()) return @@ -75,6 +76,11 @@ func TestResourceBuilder(t *testing.T) { if ok { assert.EqualValues(t, "faas.id-val", val.Str()) } + val, ok = res.Attributes().Get("faas.instance") + assert.True(t, ok) + if ok { + assert.EqualValues(t, "faas.instance-val", val.Str()) + } val, ok = res.Attributes().Get("faas.name") assert.True(t, ok) if ok { diff --git a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/testdata/config.yaml b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/testdata/config.yaml index 14d08c050cd0..00d45ed6c70b 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/testdata/config.yaml +++ b/processor/resourcedetectionprocessor/internal/gcp/internal/metadata/testdata/config.yaml @@ -13,6 +13,8 @@ all_set: enabled: true faas.id: enabled: true + faas.instance: + enabled: true faas.name: enabled: true faas.version: @@ -47,6 +49,8 @@ none_set: enabled: false faas.id: enabled: false + faas.instance: + enabled: false faas.name: enabled: false faas.version: diff --git a/processor/resourcedetectionprocessor/internal/gcp/metadata.yaml b/processor/resourcedetectionprocessor/internal/gcp/metadata.yaml index 4cfe81b2b4a0..b6ab6fcc9ef9 100644 --- a/processor/resourcedetectionprocessor/internal/gcp/metadata.yaml +++ b/processor/resourcedetectionprocessor/internal/gcp/metadata.yaml @@ -44,7 +44,11 @@ resource_attributes: type: string enabled: true faas.id: - description: The faas.id + description: The faas.id. + type: string + enabled: true + faas.instance: + description: The faas.instance type: string enabled: true k8s.cluster.name: