From 786cfaeaa08bad8a27a7e99434208bc19a44ae02 Mon Sep 17 00:00:00 2001 From: "John L. Peterson (Jack)" Date: Tue, 12 Nov 2024 11:18:28 -0500 Subject: [PATCH] [enhancement] add ocb custom collector support for ddflareextension (#30345) Co-authored-by: github-actions[bot] --- .gitlab/JOBOWNERS | 1 + .gitlab/integration_test/otel.yml | 36 +++++ comp/core/tagger/types/go.mod | 2 +- comp/otelcol/collector/impl/collector.go | 4 +- comp/otelcol/converter/impl/go.mod | 1 - .../ddflareextension/impl/configstore_test.go | 14 +- .../ddflareextension/impl/extension.go | 60 +++++---- .../ddflareextension/impl/extension_test.go | 3 +- comp/otelcol/ddflareextension/impl/factory.go | 36 ++++- .../ddflareextension/impl/factory_test.go | 4 +- comp/otelcol/ddflareextension/impl/go.mod | 46 +++---- comp/otelcol/ddflareextension/impl/server.go | 12 +- .../processor/infraattributesprocessor/go.mod | 4 +- go.mod | 126 +++++++++--------- test/new-e2e/go.mod | 2 +- test/otel/testdata/builder-config.yaml | 60 +++++++++ test/otel/testdata/collector-config.yaml | 56 ++++++++ 17 files changed, 335 insertions(+), 132 deletions(-) create mode 100644 test/otel/testdata/builder-config.yaml create mode 100644 test/otel/testdata/collector-config.yaml diff --git a/.gitlab/JOBOWNERS b/.gitlab/JOBOWNERS index 6724bad6be813..a1cab0d65cb6e 100644 --- a/.gitlab/JOBOWNERS +++ b/.gitlab/JOBOWNERS @@ -132,6 +132,7 @@ trigger_auto_staging_release @DataDog/agent-delivery integration_tests_windows* @DataDog/windows-agent integration_tests_otel @DataDog/opentelemetry docker_image_build_otel @DataDog/opentelemetry +ddflare_extension_ocb_build @DataDog/opentelemetry agent_integration_tests @DataDog/container-integrations docker_integration_tests @DataDog/container-integrations diff --git a/.gitlab/integration_test/otel.yml b/.gitlab/integration_test/otel.yml index 13a3662987a18..27289d54b395f 100644 --- a/.gitlab/integration_test/otel.yml +++ b/.gitlab/integration_test/otel.yml @@ -54,3 +54,39 @@ docker_image_build_otel: - if: $CI_COMMIT_REF_NAME =~ /.*-skip-cancel$/ when: never - when: always + + +ddflare_extension_ocb_build: + stage: integration_test + image: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/datadog-agent-buildimages/deb_x64$DATADOG_AGENT_BUILDIMAGES_SUFFIX:$DATADOG_AGENT_BUILDIMAGES + tags: ["arch:amd64"] + needs: ["go_deps"] + before_script: + - !reference [.retrieve_linux_go_deps] + - mkdir -p /tmp/otel-ci + - cp test/otel/testdata/* /tmp/otel-ci/ + - wget -O /tmp/otel-ci/ocb https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/cmd%2Fbuilder%2Fv0.111.0/ocb_0.111.0_linux_amd64 + - chmod +x /tmp/otel-ci/ocb + script: + - echo 'Building collector with OCB and test ddflare extension' + - /tmp/otel-ci/ocb --config=/tmp/otel-ci/builder-config.yaml > ocb-output.log 2>&1 + - grep -q 'Compiled' ocb-output.log || (echo "OCB failed to compile" && exit 1) + - "grep -q '{\"binary\": \"/tmp/otel-ci/otelcol-custom/otelcol-custom\"}' ocb-output.log || (echo \"OCB failed to compile\" && exit 1)" + - /tmp/otel-ci/otelcol-custom/otelcol-custom --config /tmp/otel-ci/collector-config.yaml > otelcol-custom.log 2>&1 & + - OTELCOL_PID=$! # Capture the process ID + - sleep 10 # Wait for the process to start + - grep -q 'Everything is ready. Begin running and processing data.' otelcol-custom.log || (echo "custom collector failed to start" && kill $OTELCOL_PID && exit 1) + - curl -k https://localhost:7777 > flare-info.log 2>&1 # get the dd flare info + - "grep -q '\"provided_configuration\": \"\"' flare-info.log || (echo \"provided config should not be supported with ocb\" && kill $OTELCOL_PID && exit 1)" + - grep -q 'extensions:\\n - ddflare\\n' flare-info.log || (echo "ddflare extension should be enabled" && kill $OTELCOL_PID && exit 1) + - kill $OTELCOL_PID # Kill the process + rules: + - if: $CI_PIPELINE_SOURCE =~ /^schedule.*$/ + when: never + - if: $CI_COMMIT_TAG + when: never + - if: $CI_COMMIT_MESSAGE =~ /.*\[skip cancel\].*/ + when: never + - if: $CI_COMMIT_REF_NAME =~ /.*-skip-cancel$/ + when: never + - when: always diff --git a/comp/core/tagger/types/go.mod b/comp/core/tagger/types/go.mod index c3f9487d72cd0..5b53752b6db32 100644 --- a/comp/core/tagger/types/go.mod +++ b/comp/core/tagger/types/go.mod @@ -31,7 +31,7 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 github.com/stretchr/testify v1.9.0 ) diff --git a/comp/otelcol/collector/impl/collector.go b/comp/otelcol/collector/impl/collector.go index c8fd1d1054cb2..57ecd6462a1b0 100644 --- a/comp/otelcol/collector/impl/collector.go +++ b/comp/otelcol/collector/impl/collector.go @@ -135,7 +135,7 @@ func addFactories(reqs Requires, factories otelcol.Factories) { } factories.Processors[infraattributesprocessor.Type] = infraattributesprocessor.NewFactory(reqs.Tagger, generateID) factories.Connectors[component.MustNewType("datadog")] = datadogconnector.NewFactory() - factories.Extensions[ddextension.Type] = ddextension.NewFactory(&factories, newConfigProviderSettings(reqs.URIs, reqs.Converter, false)) + factories.Extensions[ddextension.Type] = ddextension.NewFactoryForAgent(&factories, newConfigProviderSettings(reqs.URIs, reqs.Converter, false)) } var buildInfo = component.BuildInfo{ @@ -194,7 +194,7 @@ func NewComponentNoAgent(reqs RequiresNoAgent) (Provides, error) { return Provides{}, err } factories.Connectors[component.MustNewType("datadog")] = datadogconnector.NewFactory() - factories.Extensions[ddextension.Type] = ddextension.NewFactory(&factories, newConfigProviderSettings(reqs.URIs, reqs.Converter, false)) + factories.Extensions[ddextension.Type] = ddextension.NewFactoryForAgent(&factories, newConfigProviderSettings(reqs.URIs, reqs.Converter, false)) converterEnabled := reqs.Config.GetBool("otelcollector.converter.enabled") set := otelcol.CollectorSettings{ diff --git a/comp/otelcol/converter/impl/go.mod b/comp/otelcol/converter/impl/go.mod index 5449d0084f83e..dde5215bdda1f 100644 --- a/comp/otelcol/converter/impl/go.mod +++ b/comp/otelcol/converter/impl/go.mod @@ -13,7 +13,6 @@ replace ( github.com/DataDog/datadog-agent/comp/def => ../../../../comp/def github.com/DataDog/datadog-agent/comp/otelcol/converter/def => ../def github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def => ../../ddflareextension/def/ - github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl => ../../ddflareextension/impl/ github.com/DataDog/datadog-agent/pkg/api => ../../../../pkg/api github.com/DataDog/datadog-agent/pkg/collector/check/defaults => ../../../../pkg/collector/check/defaults github.com/DataDog/datadog-agent/pkg/config/env => ../../../../pkg/config/env diff --git a/comp/otelcol/ddflareextension/impl/configstore_test.go b/comp/otelcol/ddflareextension/impl/configstore_test.go index 7db1896cb549b..4d9c4ccb3de8f 100644 --- a/comp/otelcol/ddflareextension/impl/configstore_test.go +++ b/comp/otelcol/ddflareextension/impl/configstore_test.go @@ -12,11 +12,12 @@ import ( "path/filepath" "testing" + "github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector" + "go.opentelemetry.io/collector/component/componenttest" + converterimpl "github.com/DataDog/datadog-agent/comp/otelcol/converter/impl" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter" "github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor" - "github.com/open-telemetry/opentelemetry-collector-contrib/connector/datadogconnector" - "go.opentelemetry.io/collector/component/componenttest" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" @@ -39,7 +40,7 @@ func addFactories(factories otelcol.Factories) { factories.Exporters[datadogexporter.Type] = datadogexporter.NewFactory(nil, nil, nil, nil, nil) factories.Processors[infraattributesprocessor.Type] = infraattributesprocessor.NewFactory(nil, nil) factories.Connectors[component.MustNewType("datadog")] = datadogconnector.NewFactory() - factories.Extensions[Type] = NewFactory(nil, otelcol.ConfigProviderSettings{}) + factories.Extensions[Type] = NewFactoryForAgent(nil, otelcol.ConfigProviderSettings{}) } func TestGetConfDump(t *testing.T) { @@ -56,7 +57,7 @@ func TestGetConfDump(t *testing.T) { factories: &factories, configProviderSettings: newConfigProviderSettings(uriFromFile("simple-dd/config.yaml"), false), } - extension, err := NewExtension(context.TODO(), &config, componenttest.NewNopTelemetrySettings(), component.BuildInfo{}) + extension, err := NewExtension(context.TODO(), &config, componenttest.NewNopTelemetrySettings(), component.BuildInfo{}, true) assert.NoError(t, err) ext, ok := extension.(*ddExtension) @@ -148,6 +149,7 @@ func TestGetConfDump(t *testing.T) { assertEqual(t, expectedStringMap, actualStringMap) }) + } func confmapFromResolverSettings(t *testing.T, resolverSettings confmap.ResolverSettings) *confmap.Conf { @@ -189,11 +191,11 @@ func newResolverSettings(uris []string, enhanced bool) confmap.ResolverSettings httpprovider.NewFactory(), httpsprovider.NewFactory(), }, - ConverterFactories: newConverterFactorie(enhanced), + ConverterFactories: newConverterFactory(enhanced), } } -func newConverterFactorie(enhanced bool) []confmap.ConverterFactory { +func newConverterFactory(enhanced bool) []confmap.ConverterFactory { converterFactories := []confmap.ConverterFactory{} converter, err := converterimpl.NewConverter(converterimpl.Requires{}) diff --git a/comp/otelcol/ddflareextension/impl/extension.go b/comp/otelcol/ddflareextension/impl/extension.go index 3bcad26d3e68f..1e6622b77fcc1 100644 --- a/comp/otelcol/ddflareextension/impl/extension.go +++ b/comp/otelcol/ddflareextension/impl/extension.go @@ -17,6 +17,7 @@ import ( "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/confmap" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/collector/extension/extensioncapabilities" "go.opentelemetry.io/collector/otelcol" "go.uber.org/zap" @@ -41,7 +42,7 @@ type ddExtension struct { configStore *configStore } -var _ extension.Extension = (*ddExtension)(nil) +var _ extensioncapabilities.ConfigWatcher = (*ddExtension)(nil) func extensionType(s string) string { index := strings.Index(s, "/") @@ -116,17 +117,7 @@ func (ext *ddExtension) NotifyConfig(_ context.Context, conf *confmap.Conf) erro } // NewExtension creates a new instance of the extension. -func NewExtension(_ context.Context, cfg *Config, telemetry component.TelemetrySettings, info component.BuildInfo) (extensionDef.Component, error) { - ocpProvided, err := otelcol.NewConfigProvider(cfg.configProviderSettings) - if err != nil { - return nil, fmt.Errorf("failed to create configprovider: %w", err) - } - - providedConf, err := ocpProvided.Get(context.Background(), *cfg.factories) - if err != nil { - return nil, err - } - +func NewExtension(_ context.Context, cfg *Config, telemetry component.TelemetrySettings, info component.BuildInfo, providedConfigSupported bool) (extensionDef.Component, error) { ext := &ddExtension{ cfg: cfg, telemetry: telemetry, @@ -136,16 +127,28 @@ func NewExtension(_ context.Context, cfg *Config, telemetry component.TelemetryS Sources: map[string]extensionDef.OTelFlareSource{}, }, } + // only initiate the configprovider and set provided config if factories are provided + if providedConfigSupported { + ocpProvided, err := otelcol.NewConfigProvider(cfg.configProviderSettings) + if err != nil { + return nil, fmt.Errorf("failed to create configprovider: %w", err) + } + providedConf, err := ocpProvided.Get(context.Background(), *cfg.factories) + if err != nil { + return nil, err + } + conf := confmap.New() + err = conf.Marshal(providedConf) + if err != nil { + return nil, err + } - conf := confmap.New() - err = conf.Marshal(providedConf) - if err != nil { - return nil, err + ext.configStore.setProvidedConf(conf) } - - ext.configStore.setProvidedConf(conf) - - ext.server, err = newServer(cfg.HTTPConfig.Endpoint, ext) + var err error + // auth = providedConfigSupported; if value true, component was likely built by Agent and has + // bearer auth token, if false, component was likely built by OCB and has no auth token + ext.server, err = newServer(cfg.HTTPConfig.Endpoint, ext, providedConfigSupported) if err != nil { return nil, err } @@ -177,20 +180,31 @@ func (ext *ddExtension) Shutdown(ctx context.Context) error { // ServeHTTP the request handler for the extension. func (ext *ddExtension) ServeHTTP(w http.ResponseWriter, _ *http.Request) { - customer, err := ext.configStore.getProvidedConfAsString() + var ( + customer string + err error + envconfig string + ) + providedConfig, err := ext.configStore.getProvidedConf() if err != nil { w.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(w, "Unable to get provided config\n") return } + if providedConfig != nil { + customer, err = ext.configStore.getProvidedConfAsString() + if err != nil { + w.WriteHeader(http.StatusInternalServerError) + fmt.Fprintf(w, "Unable to get provided config\n") + return + } + } enhanced, err := ext.configStore.getEnhancedConfAsString() if err != nil { w.WriteHeader(http.StatusInternalServerError) fmt.Fprintf(w, "Unable to get enhanced config\n") return } - - envconfig := "" envvars := getEnvironmentAsMap() if envbytes, err := json.Marshal(envvars); err == nil { envconfig = string(envbytes) diff --git a/comp/otelcol/ddflareextension/impl/extension_test.go b/comp/otelcol/ddflareextension/impl/extension_test.go index 231b31afe05da..d9aaeaf8a6b05 100644 --- a/comp/otelcol/ddflareextension/impl/extension_test.go +++ b/comp/otelcol/ddflareextension/impl/extension_test.go @@ -40,6 +40,7 @@ import ( "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/nopreceiver" "go.opentelemetry.io/collector/receiver/otlpreceiver" + "go.uber.org/zap" ) @@ -61,7 +62,7 @@ func getTestExtension(t *testing.T) (ddflareextension.Component, error) { info := component.NewDefaultBuildInfo() cfg := getExtensionTestConfig(t) - return NewExtension(c, cfg, telemetry, info) + return NewExtension(c, cfg, telemetry, info, true) } func getResponseToHandlerRequest(t *testing.T, tokenOverride string) *httptest.ResponseRecorder { diff --git a/comp/otelcol/ddflareextension/impl/factory.go b/comp/otelcol/ddflareextension/impl/factory.go index 64c52aa9c966c..486abe5f3b499 100644 --- a/comp/otelcol/ddflareextension/impl/factory.go +++ b/comp/otelcol/ddflareextension/impl/factory.go @@ -10,11 +10,12 @@ import ( "context" "fmt" - "github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl/internal/metadata" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/otelcol" + + "github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl/internal/metadata" ) const ( @@ -28,21 +29,42 @@ type ddExtensionFactory struct { configProviderSettings otelcol.ConfigProviderSettings } -// NewFactory creates a factory for HealthCheck extension. -func NewFactory(factories *otelcol.Factories, configProviderSettings otelcol.ConfigProviderSettings) extension.Factory { +// isOCB returns true if extension was built with OCB +func (f *ddExtensionFactory) isOCB() bool { + return f.factories == nil +} + +// NewFactory creates a factory for Datadog Flare Extension for use with OCB and OSS Collector +func NewFactory() extension.Factory { + return &ddExtensionFactory{} +} + +// NewFactoryForAgent creates a factory for Datadog Flare Extension for use with Agent +func NewFactoryForAgent(factories *otelcol.Factories, configProviderSettings otelcol.ConfigProviderSettings) extension.Factory { return &ddExtensionFactory{ factories: factories, configProviderSettings: configProviderSettings, } } +// CreateExtension is deprecated as of v0.112.0 func (f *ddExtensionFactory) CreateExtension(ctx context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { config := &Config{ factories: f.factories, configProviderSettings: f.configProviderSettings, } config.HTTPConfig = cfg.(*Config).HTTPConfig - return NewExtension(ctx, config, set.TelemetrySettings, set.BuildInfo) + return NewExtension(ctx, config, set.TelemetrySettings, set.BuildInfo, !f.isOCB()) +} + +// Create creates a new instance of the Datadog Flare Extension, as of v0.112.0 or later +func (f *ddExtensionFactory) Create(ctx context.Context, set extension.Settings, cfg component.Config) (extension.Extension, error) { + config := &Config{ + factories: f.factories, + configProviderSettings: f.configProviderSettings, + } + config.HTTPConfig = cfg.(*Config).HTTPConfig + return NewExtension(ctx, config, set.TelemetrySettings, set.BuildInfo, !f.isOCB()) } func (f *ddExtensionFactory) CreateDefaultConfig() component.Config { @@ -57,6 +79,12 @@ func (f *ddExtensionFactory) Type() component.Type { return metadata.Type } +// ExtensionStability is deprecated as of v0.112.0 func (f *ddExtensionFactory) ExtensionStability() component.StabilityLevel { return metadata.ExtensionStability } + +// Stability returns the stability level of the component as of v0.112.0 or later +func (f *ddExtensionFactory) Stability() component.StabilityLevel { + return metadata.ExtensionStability +} diff --git a/comp/otelcol/ddflareextension/impl/factory_test.go b/comp/otelcol/ddflareextension/impl/factory_test.go index 5a38c3513c0cb..aea2fffda2995 100644 --- a/comp/otelcol/ddflareextension/impl/factory_test.go +++ b/comp/otelcol/ddflareextension/impl/factory_test.go @@ -19,10 +19,10 @@ func getTestFactory(t *testing.T) extension.Factory { factories, err := components() assert.NoError(t, err) - return NewFactory(&factories, newConfigProviderSettings(uriFromFile("config.yaml"), false)) + return NewFactoryForAgent(&factories, newConfigProviderSettings(uriFromFile("config.yaml"), false)) } -func TestNewFactory(t *testing.T) { +func TestNewFactoryForAgent(t *testing.T) { factory := getTestFactory(t) assert.NotNil(t, factory) diff --git a/comp/otelcol/ddflareextension/impl/go.mod b/comp/otelcol/ddflareextension/impl/go.mod index 5ab1acb2d2425..c123472c571df 100644 --- a/comp/otelcol/ddflareextension/impl/go.mod +++ b/comp/otelcol/ddflareextension/impl/go.mod @@ -103,12 +103,12 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.0.0-00010101000000-000000000000 + github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.58.0 + github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.58.0 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter v0.59.0 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.59.0 github.com/DataDog/datadog-agent/pkg/api v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel + github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0 github.com/DataDog/datadog-agent/pkg/version v0.57.1 github.com/google/go-cmp v0.6.0 github.com/gorilla/mux v1.8.1 @@ -133,6 +133,7 @@ require ( go.opentelemetry.io/collector/exporter/otlpexporter v0.111.0 go.opentelemetry.io/collector/exporter/otlphttpexporter v0.111.0 go.opentelemetry.io/collector/extension v0.111.0 + go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 go.opentelemetry.io/collector/extension/zpagesextension v0.111.0 go.opentelemetry.io/collector/otelcol v0.111.0 go.opentelemetry.io/collector/processor v0.111.0 @@ -166,30 +167,30 @@ require ( github.com/DataDog/datadog-agent/comp/core/log/mock v0.58.0-devel // indirect github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/tagger/types v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 // indirect github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/def v0.57.1 // indirect github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/forwarder/orchestrator/orchestratorinterface v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/logs/agent/config v0.56.0-rc.3 // indirect github.com/DataDog/datadog-agent/comp/otelcol/converter/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.0.0-20240525065430-d0b647bcb646 // indirect - github.com/DataDog/datadog-agent/comp/serializer/compression v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/trace/agent/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/trace/compression/def v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.56.0-rc.3 // indirect - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/model v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/serializer/compression v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/trace/agent/def v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/trace/compression/def v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.6 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 // indirect - github.com/DataDog/datadog-agent/pkg/config/structure v0.0.0-00010101000000-000000000000 // indirect + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0-rc.6 // indirect + github.com/DataDog/datadog-agent/pkg/config/structure v0.59.0-rc.6 // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 // indirect github.com/DataDog/datadog-agent/pkg/logs/auditor v0.56.0-rc.3 // indirect @@ -445,7 +446,6 @@ require ( go.opentelemetry.io/collector/exporter/exporterprofiles v0.111.0 // indirect go.opentelemetry.io/collector/extension/auth v0.111.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect - go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/featuregate v1.17.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalsignal v0.111.0 // indirect diff --git a/comp/otelcol/ddflareextension/impl/server.go b/comp/otelcol/ddflareextension/impl/server.go index 4b3c0fcf0c104..ce1d2ceadef52 100644 --- a/comp/otelcol/ddflareextension/impl/server.go +++ b/comp/otelcol/ddflareextension/impl/server.go @@ -20,8 +20,9 @@ import ( "net/http" "time" - "github.com/DataDog/datadog-agent/pkg/api/util" "github.com/gorilla/mux" + + "github.com/DataDog/datadog-agent/pkg/api/util" ) type server struct { @@ -39,7 +40,7 @@ func validateToken(next http.Handler) http.Handler { }) } -func newServer(endpoint string, handler http.Handler) (*server, error) { +func newServer(endpoint string, handler http.Handler, auth bool) (*server, error) { // Generate a self-signed certificate key, err := rsa.GenerateKey(rand.Reader, 2048) @@ -112,7 +113,12 @@ func newServer(endpoint string, handler http.Handler) (*server, error) { r := mux.NewRouter() r.Handle("/", handler) - r.Use(validateToken) + // no easy way currently to pass required bearer auth token to OSS collector; + // skip the validation if running inside a separate collector + // TODO: determine way to allow OSS collector to authenticate with agent, OTEL-2226 + if auth { + r.Use(validateToken) + } s := &http.Server{ Addr: endpoint, diff --git a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod index 78b6dde7a190a..ebb4c9bcd89cc 100644 --- a/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod +++ b/comp/otelcol/otlp/components/processor/infraattributesprocessor/go.mod @@ -33,7 +33,7 @@ replace ( ) require ( - github.com/DataDog/datadog-agent/comp/core/tagger/types v0.56.0-rc.3 + github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 github.com/stretchr/testify v1.9.0 go.opentelemetry.io/collector/component v0.111.0 go.opentelemetry.io/collector/confmap v1.17.0 @@ -48,7 +48,7 @@ require ( ) require ( - github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.2 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/go.mod b/go.mod index 0c72b1dfa9ea8..6089ad4ab18f6 100644 --- a/go.mod +++ b/go.mod @@ -148,14 +148,14 @@ require ( github.com/CycloneDX/cyclonedx-go v0.9.1 github.com/DataDog/appsec-internal-go v1.9.0 github.com/DataDog/datadog-agent/pkg/gohai v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/obfuscate v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/security/secl v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/trace v0.59.0-devel.0.20240911192058-0c2181220f85 + github.com/DataDog/datadog-agent/pkg/obfuscate v0.59.0 + github.com/DataDog/datadog-agent/pkg/remoteconfig/state v0.59.0 + github.com/DataDog/datadog-agent/pkg/security/secl v0.56.0 + github.com/DataDog/datadog-agent/pkg/trace v0.59.0 github.com/DataDog/datadog-agent/pkg/util/cgroups v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/log v0.59.0-rc.5 + github.com/DataDog/datadog-agent/pkg/util/log v0.59.0 github.com/DataDog/datadog-agent/pkg/util/pointer v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0-rc.5 + github.com/DataDog/datadog-agent/pkg/util/scrubber v0.59.0 github.com/DataDog/datadog-go/v5 v5.5.0 github.com/DataDog/datadog-operator v0.7.1-0.20241024104907-734366f3c0d1 github.com/DataDog/ebpf-manager v0.7.4 @@ -597,8 +597,8 @@ require ( require ( github.com/DataDog/datadog-agent/comp/api/authtoken v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 - github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.56.0-rc.3 + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 + github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/def v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl v0.0.0-00010101000000-000000000000 github.com/DataDog/datadog-agent/pkg/config/structure v0.60.0-devel github.com/DataDog/datadog-agent/pkg/util/defaultpaths v0.0.0-00010101000000-000000000000 @@ -617,17 +617,17 @@ require ( github.com/DATA-DOG/go-sqlmock v1.5.2 github.com/DataDog/agent-payload/v5 v5.0.135 github.com/DataDog/datadog-agent/comp/api/api/def v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/core/config v0.57.1 - github.com/DataDog/datadog-agent/comp/core/flare/types v0.57.1 - github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.57.1 - github.com/DataDog/datadog-agent/comp/core/log/def v0.58.0-devel - github.com/DataDog/datadog-agent/comp/core/log/impl v0.0.0-00010101000000-000000000000 - github.com/DataDog/datadog-agent/comp/core/log/impl-trace v0.0.0-00010101000000-000000000000 + github.com/DataDog/datadog-agent/comp/core/config v0.59.0 + github.com/DataDog/datadog-agent/comp/core/flare/types v0.59.0 + github.com/DataDog/datadog-agent/comp/core/hostname/hostnameinterface v0.59.0 + github.com/DataDog/datadog-agent/comp/core/log/def v0.59.0 + github.com/DataDog/datadog-agent/comp/core/log/impl v0.59.0 + github.com/DataDog/datadog-agent/comp/core/log/impl-trace v0.59.0 github.com/DataDog/datadog-agent/comp/core/log/mock v0.58.0-devel - github.com/DataDog/datadog-agent/comp/core/secrets v0.57.1 - github.com/DataDog/datadog-agent/comp/core/status v0.56.0-rc.3 + github.com/DataDog/datadog-agent/comp/core/secrets v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/core/status v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/core/status/statusimpl v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/core/tagger/types v0.56.2 + github.com/DataDog/datadog-agent/comp/core/tagger/types v0.59.0 github.com/DataDog/datadog-agent/comp/core/telemetry v0.57.1 github.com/DataDog/datadog-agent/comp/def v0.57.1 github.com/DataDog/datadog-agent/comp/forwarder/defaultforwarder v0.56.0-rc.3 @@ -637,28 +637,28 @@ require ( github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/def v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/collector-contrib/impl v0.56.0-rc.3 github.com/DataDog/datadog-agent/comp/otelcol/converter/def v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.57.1 + github.com/DataDog/datadog-agent/comp/otelcol/converter/impl v0.58.0 + github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/otelcol/logsagentpipeline/logsagentpipelineimpl v0.57.1 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.58.0-devel.0.20240905201012-b02662b2ba27 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.57.1 - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.56.0-rc.3 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/datadogexporter v0.59.0 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/logsagentexporter v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/exporter/serializerexporter v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/metricsclient v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/processor/infraattributesprocessor v0.59.0 github.com/DataDog/datadog-agent/comp/otelcol/otlp/testutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/serializer/compression v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/trace/agent/def v0.56.0-rc.3 - github.com/DataDog/datadog-agent/comp/trace/compression/def v0.57.1 - github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.57.1 + github.com/DataDog/datadog-agent/comp/serializer/compression v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/trace/agent/def v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/trace/compression/def v0.59.0-rc.6 + github.com/DataDog/datadog-agent/comp/trace/compression/impl-gzip v0.59.0-rc.6 github.com/DataDog/datadog-agent/comp/trace/compression/impl-zstd v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/aggregator/ckey v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/api v0.57.1 - github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/env v0.57.1 - github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0-devel - github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.5 + github.com/DataDog/datadog-agent/pkg/collector/check/defaults v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/config/env v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/config/mock v0.58.0 + github.com/DataDog/datadog-agent/pkg/config/model v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/config/remote v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/config/setup v0.57.1 + github.com/DataDog/datadog-agent/pkg/config/setup v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/config/utils v0.57.1 github.com/DataDog/datadog-agent/pkg/errors v0.56.0-rc.3 github.com/DataDog/datadog-agent/pkg/logs/auditor v0.57.1 @@ -673,38 +673,38 @@ require ( github.com/DataDog/datadog-agent/pkg/logs/sources v0.57.1 github.com/DataDog/datadog-agent/pkg/logs/status/utils v0.57.1 github.com/DataDog/datadog-agent/pkg/logs/util/testutils v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/metrics v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/metrics v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/networkdevice/profile v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/process/util/api v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/proto v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/security/seclwin v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/serializer v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/status/health v0.57.1 - github.com/DataDog/datadog-agent/pkg/tagger/types v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/tagset v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/telemetry v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/backoff v0.59.0-rc.5 + github.com/DataDog/datadog-agent/pkg/orchestrator/model v0.59.0 + github.com/DataDog/datadog-agent/pkg/process/util/api v0.59.0 + github.com/DataDog/datadog-agent/pkg/proto v0.59.0 + github.com/DataDog/datadog-agent/pkg/security/seclwin v0.56.0 + github.com/DataDog/datadog-agent/pkg/serializer v0.59.0 + github.com/DataDog/datadog-agent/pkg/status/health v0.59.0 + github.com/DataDog/datadog-agent/pkg/tagger/types v0.59.0 + github.com/DataDog/datadog-agent/pkg/tagset v0.59.0 + github.com/DataDog/datadog-agent/pkg/telemetry v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/backoff v0.59.0 github.com/DataDog/datadog-agent/pkg/util/cache v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/util/common v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/common v0.59.0 github.com/DataDog/datadog-agent/pkg/util/containers/image v0.56.2 - github.com/DataDog/datadog-agent/pkg/util/executable v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/filesystem v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/executable v0.59.0-rc.6 + github.com/DataDog/datadog-agent/pkg/util/filesystem v0.59.0-rc.6 github.com/DataDog/datadog-agent/pkg/util/flavor v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/fxutil v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/grpc v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/http v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/util/json v0.56.0-rc.3 + github.com/DataDog/datadog-agent/pkg/util/fxutil v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/grpc v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/hostname/validate v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/http v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/json v0.59.0 github.com/DataDog/datadog-agent/pkg/util/log/setup v1.0.0 - github.com/DataDog/datadog-agent/pkg/util/optional v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/sort v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/startstop v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/system v0.57.1 - github.com/DataDog/datadog-agent/pkg/util/testutil v0.56.0-rc.3 - github.com/DataDog/datadog-agent/pkg/util/uuid v0.59.0-rc.5 - github.com/DataDog/datadog-agent/pkg/util/winutil v0.57.1 - github.com/DataDog/datadog-agent/pkg/version v0.57.1 + github.com/DataDog/datadog-agent/pkg/util/optional v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/sort v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/startstop v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/system v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/testutil v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/uuid v0.59.0 + github.com/DataDog/datadog-agent/pkg/util/winutil v0.59.0 + github.com/DataDog/datadog-agent/pkg/version v0.59.0 github.com/DataDog/go-libddwaf/v3 v3.5.1 github.com/DataDog/go-sqllexer v0.0.16 github.com/Datadog/dublin-traceroute v0.0.2 @@ -741,6 +741,7 @@ require ( go.opentelemetry.io/collector/confmap/provider/httpsprovider v0.111.0 go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.17.0 go.opentelemetry.io/collector/extension v0.111.0 + go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/otelcol v0.111.0 go.opentelemetry.io/collector/processor v0.111.0 go.opentelemetry.io/collector/service v0.111.0 @@ -768,7 +769,7 @@ require ( github.com/AzureAD/microsoft-authentication-library-for-go v1.2.2 // indirect github.com/Code-Hex/go-generics-cache v1.5.1 // indirect github.com/DataDog/datadog-agent/comp/core/flare/builder v0.57.1 // indirect - github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.57.1 // indirect + github.com/DataDog/datadog-agent/comp/otelcol/otlp/components/statsprocessor v0.59.0-rc.6 // indirect github.com/DataDog/datadog-agent/pkg/config/nodetreemodel v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/config/teeconfig v0.60.0-devel // indirect github.com/DataDog/datadog-agent/pkg/logs/status/statusinterface v0.57.1 // indirect @@ -990,7 +991,6 @@ require ( go.opentelemetry.io/collector/exporter/otlphttpexporter v0.111.0 // indirect go.opentelemetry.io/collector/extension/auth v0.111.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.111.0 // indirect - go.opentelemetry.io/collector/extension/extensioncapabilities v0.111.0 // indirect go.opentelemetry.io/collector/extension/zpagesextension v0.111.0 // indirect go.opentelemetry.io/collector/filter v0.111.0 // indirect go.opentelemetry.io/collector/internal/globalgates v0.111.0 // indirect diff --git a/test/new-e2e/go.mod b/test/new-e2e/go.mod index dd791543330f2..b31bcd112bc3c 100644 --- a/test/new-e2e/go.mod +++ b/test/new-e2e/go.mod @@ -296,7 +296,7 @@ require ( ) require ( - github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.56.2 // indirect + github.com/DataDog/datadog-agent/comp/core/tagger/utils v0.59.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/authorization/v2 v2.67.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/compute/v2 v2.56.0 // indirect github.com/pulumi/pulumi-azure-native-sdk/containerservice/v2 v2.67.0 // indirect diff --git a/test/otel/testdata/builder-config.yaml b/test/otel/testdata/builder-config.yaml new file mode 100644 index 0000000000000..b465cc10af292 --- /dev/null +++ b/test/otel/testdata/builder-config.yaml @@ -0,0 +1,60 @@ +dist: + name: otelcol-custom + description: Basic OTel Collector distribution for Developers + output_path: /tmp/otel-ci/otelcol-custom + +exporters: + - gomod: go.opentelemetry.io/collector/exporter/debugexporter v0.111.0 + - gomod: go.opentelemetry.io/collector/exporter/nopexporter v0.111.0 + - gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.111.0 + - gomod: go.opentelemetry.io/collector/exporter/otlphttpexporter v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/sapmexporter v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/datadogexporter v0.111.0 + +processors: + - gomod: go.opentelemetry.io/collector/processor/batchprocessor v0.111.0 + - gomod: go.opentelemetry.io/collector/processor/memorylimiterprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/attributesprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/cumulativetodeltaprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/filterprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/groupbyattrsprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/k8sattributesprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/probabilisticsamplerprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/routingprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/tailsamplingprocessor v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/processor/transformprocessor v0.111.0 + +receivers: + - gomod: go.opentelemetry.io/collector/receiver/nopreceiver v0.111.0 + - gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/filelogreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/fluentforwardreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/hostmetricsreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/jaegerreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/receivercreator v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver v0.111.0 + +extensions: + - gomod: github.com/DataDog/datadog-agent/comp/otelcol/ddflareextension/impl v0.60.0 + path: ./comp/otelcol/ddflareextension/impl + - gomod: go.opentelemetry.io/collector/extension/zpagesextension v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/pprofextension v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/dockerobserver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecsobserver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/ecstaskobserver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/hostobserver v0.111.0 + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/observer/k8sobserver v0.111.0 + +providers: + - gomod: go.opentelemetry.io/collector/confmap/provider/envprovider v1.17.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/fileprovider v1.17.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpprovider v1.17.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/httpsprovider v1.17.0 + - gomod: go.opentelemetry.io/collector/confmap/provider/yamlprovider v1.17.0 + +connectors: + - gomod: github.com/open-telemetry/opentelemetry-collector-contrib/connector/spanmetricsconnector v0.111.0 diff --git a/test/otel/testdata/collector-config.yaml b/test/otel/testdata/collector-config.yaml new file mode 100644 index 0000000000000..a117589a48b26 --- /dev/null +++ b/test/otel/testdata/collector-config.yaml @@ -0,0 +1,56 @@ +receivers: + otlp: + protocols: + grpc: + http: + +processors: + batch: + timeout: 5s + send_batch_size: 100 + +exporters: + debug: + otlp: + endpoint: "localhost:4317" + tls: + insecure: true # Set to true for testing; adjust for production. + datadog/exporter: + api: + site: datadoghq.com + key: "12345" + +extensions: + ddflare: + include_metadata: true # Set to true for testing; adjust for production. + health_check: + zpages: + pprof: + +service: + extensions: + - ddflare + - health_check + - pprof + - zpages + pipelines: + traces: + receivers: [otlp] + processors: [batch] + exporters: [debug, otlp] + metrics: + receivers: [otlp] + processors: [batch] + exporters: [debug, otlp] + logs: + receivers: [otlp] + processors: [batch] + exporters: [datadog/exporter] + +# TODO: enable Additional configuration providers +# providers: +# env: +# file: +# http: +# https: +# yaml: