diff --git a/exporter/veopscmdbexporter/README.md b/exporter/veopscmdbexporter/README.md index acd772305a20..4a1c7001e7c0 100644 --- a/exporter/veopscmdbexporter/README.md +++ b/exporter/veopscmdbexporter/README.md @@ -4,8 +4,8 @@ | ------------- |-----------| | Stability | [alpha]: logs | | Distributions | [contrib] | -| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fhoneycombmarker%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fhoneycombmarker) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fhoneycombmarker%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fhoneycombmarker) | -| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@TylerHelmuth](https://www.github.com/TylerHelmuth), [@fchikwekwe](https://www.github.com/fchikwekwe) | +| Issues | [![Open issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aopen%20label%3Aexporter%2Fveopscmdb%20&label=open&color=orange&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aopen+is%3Aissue+label%3Aexporter%2Fveopscmdb) [![Closed issues](https://img.shields.io/github/issues-search/open-telemetry/opentelemetry-collector-contrib?query=is%3Aissue%20is%3Aclosed%20label%3Aexporter%2Fveopscmdb%20&label=closed&color=blue&logo=opentelemetry)](https://github.com/open-telemetry/opentelemetry-collector-contrib/issues?q=is%3Aclosed+is%3Aissue+label%3Aexporter%2Fveopscmdb) | +| [Code Owners](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/CONTRIBUTING.md#becoming-a-code-owner) | [@JaredTan95](https://www.github.com/JaredTan95) | [alpha]: https://github.com/open-telemetry/opentelemetry-collector#alpha [contrib]: https://github.com/open-telemetry/opentelemetry-collector-releases/tree/main/distributions/otelcol-contrib diff --git a/exporter/veopscmdbexporter/config_test.go b/exporter/veopscmdbexporter/config_test.go index 86779f20f725..e4273fbdc918 100644 --- a/exporter/veopscmdbexporter/config_test.go +++ b/exporter/veopscmdbexporter/config_test.go @@ -7,11 +7,12 @@ import ( "path/filepath" "testing" - "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/veopscmdbexporter/internal/metadata" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/confmap/confmaptest" + + "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/veopscmdbexporter/internal/metadata" ) func TestLoadConfig(t *testing.T) { @@ -27,11 +28,10 @@ func TestLoadConfig(t *testing.T) { { id: component.NewIDWithName(metadata.Type, ""), expected: &Config{ - APIKey: "test-apikey", - APIAddress: "http://localhost:5000", - CIMatches: map[string]string{ - "namespaces": "1", - }, + APIKey: "test-apikey", + APIAddress: "http://localhost:5000", + APISecret: "test-apisecret", + KubernetesClusterCIType: 58, }, }, } @@ -43,7 +43,7 @@ func TestLoadConfig(t *testing.T) { sub, err := cm.Sub(tt.id.String()) require.NoError(t, err) - require.NoError(t, component.UnmarshalConfig(sub, cfg)) + require.NoError(t, sub.Unmarshal(cfg)) if tt.expected == nil { err = component.ValidateConfig(cfg) diff --git a/exporter/veopscmdbexporter/factory_test.go b/exporter/veopscmdbexporter/factory_test.go index ab1f30dc6731..388c8cf23087 100644 --- a/exporter/veopscmdbexporter/factory_test.go +++ b/exporter/veopscmdbexporter/factory_test.go @@ -27,7 +27,7 @@ func TestFactory_CreateLogsExporter(t *testing.T) { cfg := withDefaultConfig(func(cfg *Config) { cfg.APIAddress = defaultURL }) - params := exportertest.NewNopCreateSettings() + params := exportertest.NewNopSettings() exporter, err := factory.CreateLogsExporter(context.Background(), params, cfg) require.NoError(t, err) require.NotNil(t, exporter) diff --git a/exporter/veopscmdbexporter/generated_component_test.go b/exporter/veopscmdbexporter/generated_component_test.go index 81b3125c0cca..3b592384031f 100644 --- a/exporter/veopscmdbexporter/generated_component_test.go +++ b/exporter/veopscmdbexporter/generated_component_test.go @@ -20,7 +20,7 @@ import ( ) func TestComponentFactoryType(t *testing.T) { - require.Equal(t, "honeycombmarker", NewFactory().Type().String()) + require.Equal(t, "veopscmdbexporter", NewFactory().Type().String()) } func TestComponentConfigStruct(t *testing.T) { @@ -32,12 +32,12 @@ func TestComponentLifecycle(t *testing.T) { tests := []struct { name string - createFn func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) + createFn func(ctx context.Context, set exporter.Settings, cfg component.Config) (component.Component, error) }{ { name: "logs", - createFn: func(ctx context.Context, set exporter.CreateSettings, cfg component.Config) (component.Component, error) { + createFn: func(ctx context.Context, set exporter.Settings, cfg component.Config) (component.Component, error) { return factory.CreateLogsExporter(ctx, set, cfg) }, }, @@ -52,13 +52,13 @@ func TestComponentLifecycle(t *testing.T) { for _, test := range tests { t.Run(test.name+"-shutdown", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), exportertest.NewNopSettings(), cfg) require.NoError(t, err) err = c.Shutdown(context.Background()) require.NoError(t, err) }) t.Run(test.name+"-lifecycle", func(t *testing.T) { - c, err := test.createFn(context.Background(), exportertest.NewNopCreateSettings(), cfg) + c, err := test.createFn(context.Background(), exportertest.NewNopSettings(), cfg) require.NoError(t, err) host := componenttest.NewNopHost() err = c.Start(context.Background(), host) diff --git a/exporter/veopscmdbexporter/internal/metadata/generated_status.go b/exporter/veopscmdbexporter/internal/metadata/generated_status.go index f24cb1e39522..014b926dc83b 100644 --- a/exporter/veopscmdbexporter/internal/metadata/generated_status.go +++ b/exporter/veopscmdbexporter/internal/metadata/generated_status.go @@ -7,7 +7,8 @@ import ( ) var ( - Type = component.MustNewType("veopscmdbexporter") + Type = component.MustNewType("veopscmdbexporter") + ScopeName = "otelcol/veopscmdbexporter" ) const ( diff --git a/exporter/veopscmdbexporter/logs_exporter.go b/exporter/veopscmdbexporter/logs_exporter.go index 37e573c36ec2..114e0db5aab0 100644 --- a/exporter/veopscmdbexporter/logs_exporter.go +++ b/exporter/veopscmdbexporter/logs_exporter.go @@ -6,8 +6,9 @@ package veopscmdbexporter // import "github.com/open-telemetry/opentelemetry-col import ( "context" "fmt" - "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/expr" - "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" + "net/http" + "runtime" + "github.com/tidwall/gjson" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" @@ -15,8 +16,9 @@ import ( "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pdata/plog" "go.uber.org/zap" - "net/http" - "runtime" + + "github.com/open-telemetry/opentelemetry-collector-contrib/internal/filter/expr" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/ottl/contexts/ottllog" ) type marker struct { diff --git a/exporter/veopscmdbexporter/testdata/config.yaml b/exporter/veopscmdbexporter/testdata/config.yaml index 7228e2732e5f..86f3c3627bfb 100644 --- a/exporter/veopscmdbexporter/testdata/config.yaml +++ b/exporter/veopscmdbexporter/testdata/config.yaml @@ -1,6 +1,5 @@ veopscmdbexporter: api_key: "test-apikey" api_secret: "test-apisecret" - ci_matches: - kubernetes_cluster_type: 58 + kubernetes_cluster_ci_type: 58 #namespaces_type: "1" \ No newline at end of file