Skip to content

Commit a31133b

Browse files
committed
Set Cloud Account ID default to false
1 parent ba66b9c commit a31133b

File tree

6 files changed

+11
-12
lines changed

6 files changed

+11
-12
lines changed

processor/resourcedetectionprocessor/internal/aws/eks/detector.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ func (d *detector) Detect(ctx context.Context) (resource pcommon.Resource, schem
8989
d.rb.SetCloudProvider(conventions.AttributeCloudProviderAWS)
9090
d.rb.SetCloudPlatform(conventions.AttributeCloudPlatformAWSEKS)
9191
if d.ra.CloudAccountID.Enabled {
92-
accountId := d.utils.getCloudAccountID(ctx, d.logger)
93-
d.rb.SetCloudAccountID(accountId)
92+
accountID := d.utils.getCloudAccountID(ctx, d.logger)
93+
d.rb.SetCloudAccountID(accountID)
9494
}
9595

9696
if d.ra.K8sClusterName.Enabled {

processor/resourcedetectionprocessor/internal/aws/eks/detector_test.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
const (
2222
clusterName = "my-cluster"
23-
cloudAccountId = "cloud1234"
23+
cloudAccountID = "cloud1234"
2424
)
2525

2626
type MockDetectorUtils struct {
@@ -42,7 +42,7 @@ func (detectorUtils *MockDetectorUtils) getClusterNameTagFromReservations(_ []*e
4242
}
4343

4444
func (detectorUtils *MockDetectorUtils) getCloudAccountID(_ context.Context, _ *zap.Logger) string {
45-
return cloudAccountId
45+
return cloudAccountID
4646
}
4747

4848
func TestNewDetector(t *testing.T) {
@@ -65,9 +65,8 @@ func TestEKS(t *testing.T) {
6565
require.NoError(t, err)
6666

6767
assert.Equal(t, map[string]any{
68-
"cloud.provider": "aws",
69-
"cloud.platform": "aws_eks",
70-
"cloud.account.id": "cloud1234",
68+
"cloud.provider": "aws",
69+
"cloud.platform": "aws_eks",
7170
}, res.Attributes().AsRaw(), "Resource object returned is incorrect")
7271
}
7372

processor/resourcedetectionprocessor/internal/aws/eks/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
| Name | Description | Values | Enabled |
1010
| ---- | ----------- | ------ | ------- |
11-
| cloud.account.id | The cloud account id | Any Str | true |
11+
| cloud.account.id | The cloud account id | Any Str | false |
1212
| cloud.platform | The cloud.platform | Any Str | true |
1313
| cloud.provider | The cloud.provider | Any Str | true |
1414
| k8s.cluster.name | The EKS cluster name. This attribute is currently only available when running on EC2 instances, and requires permission to run the EC2:DescribeInstances action. | Any Str | false |

processor/resourcedetectionprocessor/internal/aws/eks/internal/metadata/generated_config.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

processor/resourcedetectionprocessor/internal/aws/eks/internal/metadata/generated_resource_test.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

processor/resourcedetectionprocessor/internal/aws/eks/metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ resource_attributes:
1414
cloud.account.id:
1515
description: The cloud account id
1616
type: string
17-
enabled: true
17+
enabled: false
1818
k8s.cluster.name:
1919
description: The EKS cluster name. This attribute is currently only available when running on EC2 instances, and requires permission to run the EC2:DescribeInstances action.
2020
type: string

0 commit comments

Comments
 (0)