diff --git a/cmd/otelcol/config/collector/config.d.linux/receivers/smartagent-collectd-nginx.discovery.yaml b/cmd/otelcol/config/collector/config.d.linux/receivers/smartagent-collectd-nginx.discovery.yaml deleted file mode 100644 index ea31c33e70..0000000000 --- a/cmd/otelcol/config/collector/config.d.linux/receivers/smartagent-collectd-nginx.discovery.yaml +++ /dev/null @@ -1,32 +0,0 @@ -##################################################################################### -# This file is generated by the Splunk Distribution of the OpenTelemetry Collector. # -# # -# It reflects the default configuration bundled in the Collector executable for use # -# in discovery mode (--discovery) and is provided for reference or customization. # -# Please note that any changes made to this file will need to be reconciled during # -# upgrades of the Collector. # -##################################################################################### -# smartagent/collectd/nginx: -# enabled: true -# rule: -# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)nginx"}) and not (command matches "splunk.discovery") -# host_observer: type == "hostport" and command matches "(?i)nginx" and not (command matches "splunk.discovery") -# k8s_observer: type == "port" and pod.name matches "(?i)nginx" -# config: -# default: -# type: collectd/nginx -# url: '`(port in [443, 8443] ? "https" : "http") + "://{{.Host}}:{{.Port}}/nginx_status"`' -# timeout: 5000 -# isolatedCollectd: true -# status: -# metrics: -# - status: successful -# strict: connections.accepted -# message: smartagent/collectd/nginx receiver is working! -# statements: -# - status: failed -# regexp: "nginx plugin: curl_easy_perform failed: Operation timed out after" -# message: The container is not serving http connections. -# - status: failed -# regexp: "read-function of plugin .* failed" -# message: The integration is unable to read metrics from this endpoint. diff --git a/tests/receivers/smartagent/collectd-nginx/bundled_test.go b/tests/receivers/smartagent/collectd-nginx/bundled_test.go deleted file mode 100644 index 549cf402d7..0000000000 --- a/tests/receivers/smartagent/collectd-nginx/bundled_test.go +++ /dev/null @@ -1,78 +0,0 @@ -// Copyright Splunk, Inc. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -//go:build smartagent_integration - -package tests - -import ( - "fmt" - "path" - "runtime" - "testing" - "time" - - "github.com/stretchr/testify/require" - - "github.com/signalfx/splunk-otel-collector/tests/testutils" -) - -func TestDockerObserver(t *testing.T) { - t.Skip("Issues with test-containers networking, need to wait for -contrib to update the docker api version for us to update testcontainers-go locally") - testutils.SkipIfNotContainerTest(t) - if runtime.GOOS == "darwin" { - t.Skip("unable to share sockets between mac and d4m vm: https://github.com/docker/for-mac/issues/483#issuecomment-758836836") - } - tc := testutils.NewTestcase(t) - defer tc.PrintLogsOnFailure() - defer tc.ShutdownOTLPReceiverSink() - - _, stop := tc.Containers( - testutils.NewContainer().WithContext( - path.Join(".", "testdata", "server"), - ).WithExposedPorts( - fmt.Sprintf("%d:80", testutils.GetAvailablePort(t)), - ).WithName("nginx").WillWaitForPorts("80"), - ) - defer stop() - - _, shutdown := tc.SplunkOtelCollectorContainer( - "otlp_exporter.yaml", - func(c testutils.Collector) testutils.Collector { - cc := c.(*testutils.CollectorContainer) - cc.Container = cc.Container.WithBinds("/var/run/docker.sock:/var/run/docker.sock:ro") - cc.Container = cc.Container.WillWaitForLogs("Discovering for next") - cc.Container = cc.Container.WithUser(fmt.Sprintf("999:%d", testutils.GetDockerGID(t))) - return cc - }, - func(c testutils.Collector) testutils.Collector { - return c.WithEnv(map[string]string{ - // runner seems to be slow - "SPLUNK_DISCOVERY_DURATION": "20s", - // confirm that debug logging doesn't affect runtime - "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", - }).WithArgs( - "--discovery", - "--set", "splunk.discovery.receivers.smartagent/collectd/nginx.config.username=some_user", - "--set", "splunk.discovery.receivers.smartagent/collectd/nginx.config.password=some_password", - "--set", `splunk.discovery.extensions.k8s_observer.enabled=false`, - "--set", `splunk.discovery.extensions.host_observer.enabled=false`, - ) - }, - ) - defer shutdown() - - expectedResourceMetrics := tc.ResourceMetrics("default.yaml") - require.NoError(t, tc.OTLPReceiverSink.AssertAllMetricsReceived(t, *expectedResourceMetrics, 30*time.Second)) -} diff --git a/tests/receivers/smartagent/collectd-nginx/testdata/resource_metrics/default.yaml b/tests/receivers/smartagent/collectd-nginx/testdata/resource_metrics/default.yaml deleted file mode 100644 index 8075ae01b0..0000000000 --- a/tests/receivers/smartagent/collectd-nginx/testdata/resource_metrics/default.yaml +++ /dev/null @@ -1,22 +0,0 @@ -resource_metrics: - - scope_metrics: - - metrics: - - name: connections.accepted - type: IntMonotonicCumulativeSum - attributes: - dsname: value - host: - plugin: nginx - system.type: nginx - - name: connections.handled - type: IntMonotonicCumulativeSum - - name: nginx_connections.active - type: IntGauge - - name: nginx_connections.reading - type: IntGauge - - name: nginx_connections.waiting - type: IntGauge - - name: nginx_connections.writing - type: IntGauge - - name: nginx_requests - type: IntMonotonicCumulativeSum