Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[dev] add k8sattr processor and integ tests #2214

Merged
merged 4 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 33 additions & 71 deletions .github/config/testcases.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,14 @@
"type": "EKS",
"targets": [
{
"name": "collector-ci-amd64-1-25",
"name": "dev-collector-ci-amd64-1-23",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-amd64-1-26",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-amd64-1-25",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-amd64-1-26",
"name": "dev-collector-ci-amd64-1-26",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
Expand All @@ -37,71 +23,18 @@
"type": "EKS_ARM64",
"targets": [
{
"name": "collector-ci-arm64-1-25",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-arm64-1-26",
"name": "dev-collector-ci-arm64-1-23",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-arm64-1-25",
"name": "dev-collector-ci-arm64-1-26",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
},
{
"name": "collector-ci-arm64-1-26",
"region": "us-west-2",
"excluded_tests": [
"containerinsight_eks"
]
}
]
},
{
"type": "EKS_ADOT_OPERATOR",
"targets": [
{
"name": "operator-ci-amd64-1-22",
"region": "us-west-2"
},
{
"name": "operator-ci-amd64-1-23",
"region": "us-west-2"
}
]
},
{
"type": "EKS_ADOT_OPERATOR_ARM64",
"targets": [
{
"name": "operator-ci-arm64-1-22",
"region": "us-west-2"
},
{
"name": "operator-ci-arm64-1-23",
"region": "us-west-2"
}
]
},
{
"type": "EKS_FARGATE",
"targets": [
{
"name": "collector-ci-fargate-1-22",
"region": "us-west-2"
},
{
"name": "collector-ci-fargate-1-23",
"region": "us-west-2"
}
]
}
Expand Down Expand Up @@ -543,6 +476,35 @@
"platforms": [
"ECS"
]
},
{
"case_name": "otlp_metric_k8sattr",
"platforms": [
"EKS",
"EKS_ARM64"
]
},
{
"case_name": "otlp_metric_k8sattr_podassoc",
"platforms": [
"EKS",
"EKS_ARM64"
]
},
{
"case_name": "otlp_trace_k8sattr",
"platforms": [
"EKS",
"EKS_ARM64"
]
},
{
"case_name": "otlp_trace_k8sattr_podassoc",
"platforms": [
"EKS",
"EKS_ARM64"
]
}

]
}
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ env:
GITHB_RUN_ID: ${{ github.run_id }}
DDB_TABLE_NAME: BatchTestCache
MAX_JOBS: 110
BATCH_INCLUDED_SERVICES: ECS,EC2
BATCH_INCLUDED_SERVICES: ECS,EC2,EKS,EKS_ARM64
GO_VERSION: ~1.20.5


Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.81.0
github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.81.0
Expand Down
6 changes: 4 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw=
Expand Down Expand Up @@ -453,7 +453,7 @@ github.com/esimonov/ifshort v1.0.1/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+
github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY=
github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg=
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 h1:fP04zlkPjAGpsduG7xN3rRkxjAqkJaIQnnkNYYw/pAk=
Expand Down Expand Up @@ -1351,6 +1351,7 @@ github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.81.
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.81.0/go.mod h1:gkymmEWoAYS3IAJizCVWHsnLlO2srV6jTlauy3ew8Vg=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.81.0 h1:msu2VMtc1vuGT5vqWdMLiLigGIOxLQTb9p6YkkJ79lY=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.81.0/go.mod h1:wnpEQ9JRrLAhnqYSxpa6f/S40xGri7DHG92qhZdTNS4=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.81.0 h1:RakPwL13EbYBSIszk4ahd09IJrWlCEdWIb453rOr8lo=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.81.0 h1:Lzq4iYipnrt7ioOFlZRQcLwpchuK2bpcdFK/iFmZsoQ=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.81.0/go.mod h1:bKa1dpIjQ5v+FX1ReDlvCfC9DlOtAezIcnr+rCXTQLM=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.81.0 h1:60rGHxmwTtBYfwhhi+Renb3BOYwmrH08ZrvkWImXqVk=
Expand Down Expand Up @@ -1399,6 +1400,7 @@ github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterproces
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0 h1:nyeNjHVyYf2/8DlkeC49u9z9ndftMcAjrX0MDIcLbWw=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0/go.mod h1:MQgcC0mFP5YyG2km/VC0dmQsoOOAoITRnrxhZwU85xg=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0 h1:5opgAzbubdgZ3Xu6O4TMBuo68IXXLahlyI50BvhIciY=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0/go.mod h1:4RJwmx/TyCF1RtbwZFjDHWHzuEOi2sBH0/n05na0cNc=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0 h1:2XuxWP98EOC7PWPZ7xvTKdn3qvm0U2USDGqXbUFMIWo=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0/go.mod h1:PiLYVgFMqe/lBAMEbiscTXr10QhdZFkdwWCvZDr6zNo=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.81.0 h1:ogNySeBs0zqWuf4cDGvBzIZwZ86MznAcv/EBtrj9s9w=
Expand Down
2 changes: 2 additions & 0 deletions pkg/defaultcomponents/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor"
Expand Down Expand Up @@ -140,6 +141,7 @@ func Components() (otelcol.Factories, error) {
deltatorateprocessor.NewFactory(),
batchprocessor.NewFactory(),
memorylimiterprocessor.NewFactory(),
k8sattributesprocessor.NewFactory(),
}
processors, err := processor.MakeFactoryMap(processorList...)

Expand Down
6 changes: 4 additions & 2 deletions pkg/defaultcomponents/defaults_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,18 @@
package defaultcomponents

import (
"go.opentelemetry.io/collector/featuregate"
"testing"

"go.opentelemetry.io/collector/featuregate"

"github.com/stretchr/testify/assert"
)

const (
exportersCount = 14
receiversCount = 9
extensionsCount = 7
processorCount = 14
processorCount = 15
)

// Assert that the components behind feature gate are not in the default
Expand Down Expand Up @@ -101,6 +102,7 @@ func TestComponents(t *testing.T) {
assert.NotNil(t, processors["deltatorate"])
assert.NotNil(t, processors["groupbytrace"])
assert.NotNil(t, processors["tail_sampling"])
assert.NotNil(t, processors["k8sattributes"])

// Ensure that the components behind feature gates aren't included
assert.Nil(t, receivers["filelog"])
Expand Down
1 change: 1 addition & 0 deletions testbed/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ require (
github.com/open-telemetry/opentelemetry-collector-contrib/processor/deltatorateprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.81.0 // indirect
github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.81.0 // indirect
Expand Down
6 changes: 4 additions & 2 deletions testbed/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7
github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible h1:HzKLt3kIwMm4KeJYTdx9EbjRYTySD/t8i1Ee/W5EGXw=
github.com/Azure/azure-sdk-for-go v65.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1 h1:UQHMgLO+TxOElx5B5HZ4hJQsoJ/PvUvKRhJHDQXO8P8=
github.com/Azure/go-ansiterm v0.0.0-20210617225240-d185dfc1b5a1/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-autorest v14.2.0+incompatible h1:V5VMDjClD3GiElqLWO7mz2MxNAK/vTfRHdAubSIPRgs=
github.com/Azure/go-autorest v14.2.0+incompatible/go.mod h1:r+4oMnoxhatjLLJ6zxSWATqVooLgysK6ZNox3g/xq24=
github.com/Azure/go-autorest/autorest v0.11.12/go.mod h1:eipySxLmqSyC5s5k1CLupqet0PSENBEDP93LQ9a8QYw=
Expand Down Expand Up @@ -449,7 +449,7 @@ github.com/esimonov/ifshort v1.0.1/go.mod h1:yZqNJUrNn20K8Q9n2CrjTKYyVEmX209Hgu+
github.com/euank/go-kmsg-parser v2.0.0+incompatible h1:cHD53+PLQuuQyLZeriD1V/esuG4MuU0Pjs5y6iknohY=
github.com/euank/go-kmsg-parser v2.0.0+incompatible/go.mod h1:MhmAMZ8V4CYH4ybgdRwPr2TU5ThnS43puaKEMpja1uw=
github.com/evanphx/json-patch v4.9.0+incompatible/go.mod h1:50XU6AFN0ol/bzJsmQLiYLvXMP4fmwYFNcr97nuDLSk=
github.com/evanphx/json-patch v4.12.0+incompatible h1:4onqiflcdA9EOZ4RxV643DvftH5pOlLGNtQ5lPWQu84=
github.com/evanphx/json-patch v5.6.0+incompatible h1:jBYDEEiFBPxA0v50tFdvOzQQTCvpL6mnFh5mB2/l16U=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 h1:JWuenKqqX8nojtoVVWjGfOF9635RETekkoH6Cc9SX0A=
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052/go.mod h1:UbMTZqLaRiH3MsBH8va0n7s1pQYcu3uTb8G4tygF4Zg=
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 h1:fP04zlkPjAGpsduG7xN3rRkxjAqkJaIQnnkNYYw/pAk=
Expand Down Expand Up @@ -1359,6 +1359,7 @@ github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.81.
github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter v0.81.0/go.mod h1:gkymmEWoAYS3IAJizCVWHsnLlO2srV6jTlauy3ew8Vg=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.81.0 h1:msu2VMtc1vuGT5vqWdMLiLigGIOxLQTb9p6YkkJ79lY=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig v0.81.0/go.mod h1:wnpEQ9JRrLAhnqYSxpa6f/S40xGri7DHG92qhZdTNS4=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8stest v0.81.0 h1:RakPwL13EbYBSIszk4ahd09IJrWlCEdWIb453rOr8lo=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.81.0 h1:Lzq4iYipnrt7ioOFlZRQcLwpchuK2bpcdFK/iFmZsoQ=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/kubelet v0.81.0/go.mod h1:bKa1dpIjQ5v+FX1ReDlvCfC9DlOtAezIcnr+rCXTQLM=
github.com/open-telemetry/opentelemetry-collector-contrib/internal/metadataproviders v0.81.0 h1:60rGHxmwTtBYfwhhi+Renb3BOYwmrH08ZrvkWImXqVk=
Expand Down Expand Up @@ -1408,6 +1409,7 @@ github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterproces
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0 h1:nyeNjHVyYf2/8DlkeC49u9z9ndftMcAjrX0MDIcLbWw=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbytraceprocessor v0.81.0/go.mod h1:MQgcC0mFP5YyG2km/VC0dmQsoOOAoITRnrxhZwU85xg=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0 h1:5opgAzbubdgZ3Xu6O4TMBuo68IXXLahlyI50BvhIciY=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.81.0/go.mod h1:4RJwmx/TyCF1RtbwZFjDHWHzuEOi2sBH0/n05na0cNc=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0 h1:2XuxWP98EOC7PWPZ7xvTKdn3qvm0U2USDGqXbUFMIWo=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricsgenerationprocessor v0.81.0/go.mod h1:PiLYVgFMqe/lBAMEbiscTXr10QhdZFkdwWCvZDr6zNo=
github.com/open-telemetry/opentelemetry-collector-contrib/processor/metricstransformprocessor v0.81.0 h1:ogNySeBs0zqWuf4cDGvBzIZwZ86MznAcv/EBtrj9s9w=
Expand Down