diff --git a/.github/workflows/verify-collector-ocb.yml b/.github/workflows/verify-collector-ocb.yml index e283b9072..177a286ea 100644 --- a/.github/workflows/verify-collector-ocb.yml +++ b/.github/workflows/verify-collector-ocb.yml @@ -15,12 +15,12 @@ jobs: go-version: "1.23.0" - name: Generate collector with ocb working-directory: ./collector - run: "make genodigoscol" + run: "make genodigoscol generate" - name: Verify Generate working-directory: ./collector run: | if [[ $(git diff --exit-code) ]]; then git diff - echo "odigos collector distribution module is not in sync with builder config. Please run 'make genodigoscol' in 'collector' directory and commit the changes." + echo "odigos collector distribution module is not in sync with builder config. Please run 'make genodigoscol generate' in 'collector' directory and commit the changes." exit 1 fi diff --git a/collector/processors/odigosconditionalattributes/generated_components_test.go b/collector/processors/odigosconditionalattributes/generated_component_test.go similarity index 100% rename from collector/processors/odigosconditionalattributes/generated_components_test.go rename to collector/processors/odigosconditionalattributes/generated_component_test.go diff --git a/collector/processors/odigosconditionalattributes/internal/metadata/generated_status.go b/collector/processors/odigosconditionalattributes/internal/metadata/generated_status.go new file mode 100644 index 000000000..9d969876b --- /dev/null +++ b/collector/processors/odigosconditionalattributes/internal/metadata/generated_status.go @@ -0,0 +1,15 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +var ( + Type = component.MustNewType("odigosconditionalattributes") +) + +const ( + TracesStability = component.StabilityLevelBeta +) diff --git a/collector/processors/odigosconditionalattributes/metadata.yaml b/collector/processors/odigosconditionalattributes/metadata.yaml index 0595d4bb6..f38e2f9d2 100644 --- a/collector/processors/odigosconditionalattributes/metadata.yaml +++ b/collector/processors/odigosconditionalattributes/metadata.yaml @@ -1,4 +1,4 @@ -type: odigosconditionalattributesprocessor +type: odigosconditionalattributes status: class: processor stability: diff --git a/collector/processors/odigossqldboperationprocessor/generated_component_test.go b/collector/processors/odigossqldboperationprocessor/generated_component_test.go index ac5209816..2db71183e 100644 --- a/collector/processors/odigossqldboperationprocessor/generated_component_test.go +++ b/collector/processors/odigossqldboperationprocessor/generated_component_test.go @@ -1,3 +1,5 @@ +// Code generated by mdatagen. DO NOT EDIT. + package odigossqldboperationprocessor import ( @@ -11,6 +13,8 @@ import ( "go.opentelemetry.io/collector/confmap/confmaptest" "go.opentelemetry.io/collector/consumer/consumertest" "go.opentelemetry.io/collector/pdata/pcommon" + "go.opentelemetry.io/collector/pdata/plog" + "go.opentelemetry.io/collector/pdata/pmetric" "go.opentelemetry.io/collector/pdata/ptrace" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processortest" @@ -62,6 +66,22 @@ func TestComponentLifecycle(t *testing.T) { require.NoError(t, err) require.NotPanics(t, func() { switch test.name { + case "logs": + e, ok := c.(processor.Logs) + require.True(t, ok) + logs := generateLifecycleTestLogs() + if !e.Capabilities().MutatesData { + logs.MarkReadOnly() + } + err = e.ConsumeLogs(context.Background(), logs) + case "metrics": + e, ok := c.(processor.Metrics) + require.True(t, ok) + metrics := generateLifecycleTestMetrics() + if !e.Capabilities().MutatesData { + metrics.MarkReadOnly() + } + err = e.ConsumeMetrics(context.Background(), metrics) case "traces": e, ok := c.(processor.Traces) require.True(t, ok) @@ -79,6 +99,29 @@ func TestComponentLifecycle(t *testing.T) { } } +func generateLifecycleTestLogs() plog.Logs { + logs := plog.NewLogs() + rl := logs.ResourceLogs().AppendEmpty() + rl.Resource().Attributes().PutStr("resource", "R1") + l := rl.ScopeLogs().AppendEmpty().LogRecords().AppendEmpty() + l.Body().SetStr("test log message") + l.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return logs +} + +func generateLifecycleTestMetrics() pmetric.Metrics { + metrics := pmetric.NewMetrics() + rm := metrics.ResourceMetrics().AppendEmpty() + rm.Resource().Attributes().PutStr("resource", "R1") + m := rm.ScopeMetrics().AppendEmpty().Metrics().AppendEmpty() + m.SetName("test_metric") + dp := m.SetEmptyGauge().DataPoints().AppendEmpty() + dp.Attributes().PutStr("test_attr", "value_1") + dp.SetIntValue(123) + dp.SetTimestamp(pcommon.NewTimestampFromTime(time.Now())) + return metrics +} + func generateLifecycleTestTraces() ptrace.Traces { traces := ptrace.NewTraces() rs := traces.ResourceSpans().AppendEmpty() diff --git a/collector/processors/odigossqldboperationprocessor/generated_package_test.go b/collector/processors/odigossqldboperationprocessor/generated_package_test.go index aa0da6e50..d756e533d 100644 --- a/collector/processors/odigossqldboperationprocessor/generated_package_test.go +++ b/collector/processors/odigossqldboperationprocessor/generated_package_test.go @@ -1,9 +1,10 @@ +// Code generated by mdatagen. DO NOT EDIT. + package odigossqldboperationprocessor import ( - "testing" - "go.uber.org/goleak" + "testing" ) func TestMain(m *testing.M) { diff --git a/collector/processors/odigossqldboperationprocessor/internal/metadata/generated_status.go b/collector/processors/odigossqldboperationprocessor/internal/metadata/generated_status.go new file mode 100644 index 000000000..6b8f2fbf9 --- /dev/null +++ b/collector/processors/odigossqldboperationprocessor/internal/metadata/generated_status.go @@ -0,0 +1,15 @@ +// Code generated by mdatagen. DO NOT EDIT. + +package metadata + +import ( + "go.opentelemetry.io/collector/component" +) + +var ( + Type = component.MustNewType("odigossqldboperationprocessor") +) + +const ( + TracesStability = component.StabilityLevelBeta +)