From 097a7cadb7f11fd6347d0f7a19390002df2c2962 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 10 Jan 2025 16:49:44 -0800 Subject: [PATCH 1/9] Add envoy metrics discovery bundle --- .../receivers/envoy.discovery.yaml | 39 ++ docker/docker-compose.yml | 7 + docker/envoy/Dockerfile | 1 + .../bundle.d/receivers/envoy.discovery.yaml | 35 ++ .../receivers/envoy.discovery.yaml.tmpl | 31 ++ .../discovery/bundle/bundle_gen.go | 2 + .../discovery/bundle/bundledfs_other_test.go | 1 + .../discovery/bundle/bundledfs_others.go | 1 + .../discovery/bundle/bundledfs_windows.go | 1 + .../bundle/bundledfs_windows_test.go | 1 + .../discovery/bundle/components.go | 2 + tests/receivers/envoy/bundled_test.go | 89 +++++ tests/receivers/envoy/testdata/expected.yaml | 337 ++++++++++++++++++ .../envoy/testdata/otlp_exporter.yaml | 13 + 14 files changed, 560 insertions(+) create mode 100644 cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml create mode 100644 docker/envoy/Dockerfile create mode 100644 internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml create mode 100644 internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl create mode 100644 tests/receivers/envoy/bundled_test.go create mode 100644 tests/receivers/envoy/testdata/expected.yaml create mode 100644 tests/receivers/envoy/testdata/otlp_exporter.yaml diff --git a/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml b/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml new file mode 100644 index 0000000000..c2d633ab70 --- /dev/null +++ b/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml @@ -0,0 +1,39 @@ +##################################################################################### +# 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. # +##################################################################################### +# prometheus: +# enabled: true +# rule: +# docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") +# host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") +# k8s_observer: type == "port" and pod.name matches "(?i)envoy" +# config: +# default: +# config: +# scrape_configs: +# - job_name: 'envoy' +# metrics_path: /stats/prometheus +# scrape_interval: 10s +# static_configs: +# - targets: ['`host`:9901'] +# metric_relabel_configs: +# - source_labels: [__name__] +# action: keep +# regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' +# status: +# metrics: +# - status: successful +# strict: envoy_cluster_upstream_cx_active +# message: envoy prometheus receiver is working! +# statements: +# - status: failed +# regexp: "connection refused" +# message: The container is not serving http connections. +# - status: failed +# regexp: "dial tcp: lookup" +# message: Unable to resolve envoy prometheus tcp endpoint diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 61e090f1d0..7c8d6ff608 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -80,6 +80,13 @@ services: - integration environment: - ELASTIC_PASSWORD=$ELASTIC_PASSWORD + envoy: + image: quay.io/splunko11ytest/envoy:latest + profiles: + - integration + build: ./envoy + ports: + - "9901:9901" # Haproxy image for haproxy test: haproxy: image: quay.io/splunko11ytest/haproxy:latest diff --git a/docker/envoy/Dockerfile b/docker/envoy/Dockerfile new file mode 100644 index 0000000000..a15d7af790 --- /dev/null +++ b/docker/envoy/Dockerfile @@ -0,0 +1 @@ +FROM envoyproxy/envoy:v1.32-latest \ No newline at end of file diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml new file mode 100644 index 0000000000..9555df3474 --- /dev/null +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml @@ -0,0 +1,35 @@ +##################################################################################### +# Do not edit manually! # +# All changes must be made to associated .tmpl file before running 'make bundle.d'. # +##################################################################################### +prometheus: + enabled: true + rule: + docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") + host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") + k8s_observer: type == "port" and pod.name matches "(?i)envoy" + config: + default: + config: + scrape_configs: + - job_name: 'envoy' + metrics_path: /stats/prometheus + scrape_interval: 10s + static_configs: + - targets: ['`host`:9901'] + metric_relabel_configs: + - source_labels: [__name__] + action: keep + regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' + status: + metrics: + - status: successful + strict: envoy_cluster_upstream_cx_active + message: envoy prometheus receiver is working! + statements: + - status: failed + regexp: "connection refused" + message: The container is not serving http connections. + - status: failed + regexp: "dial tcp: lookup" + message: Unable to resolve envoy prometheus tcp endpoint diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl new file mode 100644 index 0000000000..0a1d4a1509 --- /dev/null +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl @@ -0,0 +1,31 @@ +{{ receiver "prometheus" }}: + enabled: true + rule: + docker_observer: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) and not (command matches "splunk.discovery") + host_observer: type == "hostport" and command matches "(?i)envoy" and not (command matches "splunk.discovery") + k8s_observer: type == "port" and pod.name matches "(?i)envoy" + config: + default: + config: + scrape_configs: + - job_name: 'envoy' + metrics_path: /stats/prometheus + scrape_interval: 10s + static_configs: + - targets: ['`host`:9901'] + metric_relabel_configs: + - source_labels: [__name__] + action: keep + regex: '(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)' + status: + metrics: + - status: successful + strict: envoy_cluster_upstream_cx_active + message: envoy prometheus receiver is working! + statements: + - status: failed + regexp: "connection refused" + message: The container is not serving http connections. + - status: failed + regexp: "dial tcp: lookup" + message: Unable to resolve envoy prometheus tcp endpoint diff --git a/internal/confmapprovider/discovery/bundle/bundle_gen.go b/internal/confmapprovider/discovery/bundle/bundle_gen.go index 060af08308..12c2b77e66 100644 --- a/internal/confmapprovider/discovery/bundle/bundle_gen.go +++ b/internal/confmapprovider/discovery/bundle/bundle_gen.go @@ -25,6 +25,8 @@ //go:generate discoverybundler --render --template bundle.d/receivers/apache.discovery.yaml.tmpl //go:generate discoverybundler --render --commented --dir ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/apache.discovery.yaml.tmpl +//go:generate discoverybundler --render --template bundle.d/receivers/envoy.discovery.yaml.tmpl +//go:generate discoverybundler --render --commented --dir ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/envoy.discovery.yaml.tmpl //go:generate discoverybundler --render --template bundle.d/receivers/jmx-cassandra.discovery.yaml.tmpl //go:generate discoverybundler --render --commented --dir ../../../../cmd/otelcol/config/collector/config.d.linux/receivers -t bundle.d/receivers/jmx-cassandra.discovery.yaml.tmpl //go:generate discoverybundler --render --template bundle.d/receivers/kafkametrics.discovery.yaml.tmpl diff --git a/internal/confmapprovider/discovery/bundle/bundledfs_other_test.go b/internal/confmapprovider/discovery/bundle/bundledfs_other_test.go index c75bbe417f..4914ac06a3 100644 --- a/internal/confmapprovider/discovery/bundle/bundledfs_other_test.go +++ b/internal/confmapprovider/discovery/bundle/bundledfs_other_test.go @@ -28,6 +28,7 @@ func TestBundleDir(t *testing.T) { require.NoError(t, err) require.Equal(t, []string{ "bundle.d/receivers/apache.discovery.yaml", + "bundle.d/receivers/envoy.discovery.yaml", "bundle.d/receivers/jmx-cassandra.discovery.yaml", "bundle.d/receivers/kafkametrics.discovery.yaml", "bundle.d/receivers/mongodb.discovery.yaml", diff --git a/internal/confmapprovider/discovery/bundle/bundledfs_others.go b/internal/confmapprovider/discovery/bundle/bundledfs_others.go index f17509a558..292f6aaf50 100644 --- a/internal/confmapprovider/discovery/bundle/bundledfs_others.go +++ b/internal/confmapprovider/discovery/bundle/bundledfs_others.go @@ -26,6 +26,7 @@ import ( //go:embed bundle.d/extensions/host-observer.discovery.yaml //go:embed bundle.d/extensions/k8s-observer.discovery.yaml //go:embed bundle.d/receivers/apache.discovery.yaml +//go:embed bundle.d/receivers/envoy.discovery.yaml //go:embed bundle.d/receivers/jmx-cassandra.discovery.yaml //go:embed bundle.d/receivers/kafkametrics.discovery.yaml //go:embed bundle.d/receivers/mongodb.discovery.yaml diff --git a/internal/confmapprovider/discovery/bundle/bundledfs_windows.go b/internal/confmapprovider/discovery/bundle/bundledfs_windows.go index da13549b6e..aa7c83298c 100644 --- a/internal/confmapprovider/discovery/bundle/bundledfs_windows.go +++ b/internal/confmapprovider/discovery/bundle/bundledfs_windows.go @@ -26,6 +26,7 @@ import ( //go:embed bundle.d/extensions/host-observer.discovery.yaml //go:embed bundle.d/extensions/k8s-observer.discovery.yaml //go:embed bundle.d/receivers/apache.discovery.yaml +//go:embed bundle.d/receivers/envoy.discovery.yaml //go:embed bundle.d/receivers/jmx-cassandra.discovery.yaml //go:embed bundle.d/receivers/kafkametrics.discovery.yaml //go:embed bundle.d/receivers/mongodb.discovery.yaml diff --git a/internal/confmapprovider/discovery/bundle/bundledfs_windows_test.go b/internal/confmapprovider/discovery/bundle/bundledfs_windows_test.go index a94c8a6202..49d1604198 100644 --- a/internal/confmapprovider/discovery/bundle/bundledfs_windows_test.go +++ b/internal/confmapprovider/discovery/bundle/bundledfs_windows_test.go @@ -28,6 +28,7 @@ func TestBundleDir(t *testing.T) { require.NoError(t, err) require.Equal(t, []string{ "bundle.d/receivers/apache.discovery.yaml", + "bundle.d/receivers/envoy.discovery.yaml", "bundle.d/receivers/jmx-cassandra.discovery.yaml", "bundle.d/receivers/kafkametrics.discovery.yaml", "bundle.d/receivers/mongodb.discovery.yaml", diff --git a/internal/confmapprovider/discovery/bundle/components.go b/internal/confmapprovider/discovery/bundle/components.go index 7f025de19a..05bc6d5f16 100644 --- a/internal/confmapprovider/discovery/bundle/components.go +++ b/internal/confmapprovider/discovery/bundle/components.go @@ -32,6 +32,7 @@ var ( // in Components.Linux. If desired in windows BundledFS, ensure they are included in Components.Windows. receivers = []string{ "apache", + "envoy", "jmx-cassandra", "kafkametrics", "mongodb", @@ -66,6 +67,7 @@ var ( Windows: func() map[string]struct{} { windows := map[string]struct{}{ "apache": {}, + "envoy": {}, "jmx-cassandra": {}, "kafkametrics": {}, "mongodb": {}, diff --git a/tests/receivers/envoy/bundled_test.go b/tests/receivers/envoy/bundled_test.go new file mode 100644 index 0000000000..888edc009d --- /dev/null +++ b/tests/receivers/envoy/bundled_test.go @@ -0,0 +1,89 @@ +// 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 integration + +package tests + +import ( + "fmt" + "path/filepath" + "testing" + "time" + + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/golden" + "github.com/open-telemetry/opentelemetry-collector-contrib/pkg/pdatatest/pmetrictest" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "github.com/signalfx/splunk-otel-collector/tests/testutils" +) + +func TestEnvoyDockerObserver(t *testing.T) { + t.Skip("Redis data points are also discovered since Redis runs, making this test fail.") + testutils.SkipIfNotContainerTest(t) + dockerSocket := testutils.CreateDockerSocketProxy(t) + require.NoError(t, dockerSocket.Start()) + t.Cleanup(func() { + dockerSocket.Stop() + }) + + tc := testutils.NewTestcase(t) + defer tc.PrintLogsOnFailure() + defer tc.ShutdownOTLPReceiverSink() + _, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(collector testutils.Collector) testutils.Collector { + return collector.WithEnv(map[string]string{ + "SPLUNK_DISCOVERY_DURATION": "20s", + "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", + }).WithArgs( + "--discovery", + "--set", `splunk.discovery.extensions.k8s_observer.enabled=false`, + "--set", `splunk.discovery.extensions.host_observer.enabled=false`, + "--set", fmt.Sprintf("splunk.discovery.extensions.docker_observer.config.endpoint=tcp://%s", dockerSocket.ContainerEndpoint), + ) + }) + defer shutdown() + + expected, err := golden.ReadMetrics(filepath.Join("testdata", "expected.yaml")) + require.NoError(t, err) + require.EventuallyWithT(t, func(tt *assert.CollectT) { + if len(tc.OTLPReceiverSink.AllMetrics()) == 0 { + assert.Fail(tt, "No metrics collected") + return + } + err := pmetrictest.CompareMetrics(expected, tc.OTLPReceiverSink.AllMetrics()[len(tc.OTLPReceiverSink.AllMetrics())-1], + pmetrictest.IgnoreResourceAttributeValue("service.instance.id"), + pmetrictest.IgnoreResourceAttributeValue("net.host.port"), + pmetrictest.IgnoreResourceAttributeValue("net.host.name"), + pmetrictest.IgnoreResourceAttributeValue("server.address"), + pmetrictest.IgnoreResourceAttributeValue("container.name"), + pmetrictest.IgnoreResourceAttributeValue("server.port"), + pmetrictest.IgnoreResourceAttributeValue("service.name"), + pmetrictest.IgnoreResourceAttributeValue("service_instance_id"), + pmetrictest.IgnoreResourceAttributeValue("service_version"), + pmetrictest.IgnoreMetricAttributeValue("service_version"), + pmetrictest.IgnoreMetricAttributeValue("service_instance_id"), + pmetrictest.IgnoreResourceAttributeValue("server.address"), + pmetrictest.IgnoreTimestamp(), + pmetrictest.IgnoreStartTimestamp(), + pmetrictest.IgnoreMetricDataPointsOrder(), + pmetrictest.IgnoreScopeMetricsOrder(), + pmetrictest.IgnoreScopeVersion(), + pmetrictest.IgnoreResourceMetricsOrder(), + pmetrictest.IgnoreMetricsOrder(), + pmetrictest.IgnoreMetricValues(), + ) + assert.NoError(tt, err) + }, 30*time.Second, 1*time.Second) +} diff --git a/tests/receivers/envoy/testdata/expected.yaml b/tests/receivers/envoy/testdata/expected.yaml new file mode 100644 index 0000000000..05d8d67eb7 --- /dev/null +++ b/tests/receivers/envoy/testdata/expected.yaml @@ -0,0 +1,337 @@ +resourceMetrics: + - resource: + attributes: + - key: container.image.name + value: + stringValue: envoyproxy/envoy + - key: http.scheme + value: + stringValue: http + - key: net.host.name + value: + stringValue: host.docker.internal + - key: net.host.port + value: + stringValue: "9901" + - key: server.address + value: + stringValue: host.docker.internal + - key: server.port + value: + stringValue: "9901" + - key: service.instance.id + value: + stringValue: host.docker.internal:9901 + - key: service.name + value: + stringValue: envoy + - key: url.scheme + value: + stringValue: http + scopeMetrics: + - metrics: + - gauge: + dataPoints: + - asDouble: 1 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_membership_total + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_upstream_cx_active + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_upstream_rq_active + - description: The scraping was successful + gauge: + dataPoints: + - asDouble: 1 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: up + - description: The number of samples the target exposed + gauge: + dataPoints: + - asDouble: 694 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: scrape_samples_scraped + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_cluster_upstream_cx_connect_fail + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_listener_downstream_global_cx_overflow + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_membership_degraded + - description: The approximate number of new series in this scrape + gauge: + dataPoints: + - asDouble: 17 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: scrape_series_added + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_cluster_upstream_cx_total + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_cluster_upstream_rq_pending_overflow + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_listener_downstream_cx_overload_reject + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - description: Duration of the scrape + gauge: + dataPoints: + - asDouble: 0.044218584 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: scrape_duration_seconds + unit: s + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_listener_downstream_cx_total + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_upstream_rq_pending_active + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_listener_downstream_cx_active + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_listener_downstream_cx_transport_socket_connect_timeout + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - gauge: + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: envoy_cluster_membership_excluded + - description: The number of samples remaining after metric relabeling was applied + gauge: + dataPoints: + - asDouble: 17 + timeUnixNano: "1000000" + metadata: + - key: prometheus.type + value: + stringValue: gauge + name: scrape_samples_post_metric_relabeling + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_cluster_upstream_rq_timeout + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_cluster_upstream_rq_total + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_cluster_name + value: + stringValue: service_envoyproxy_io + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + - metadata: + - key: prometheus.type + value: + stringValue: counter + name: envoy_listener_downstream_cx_overflow + sum: + aggregationTemporality: 2 + dataPoints: + - asDouble: 0 + attributes: + - key: envoy_listener_address + value: + stringValue: 0.0.0.0_10000 + startTimeUnixNano: "1000000" + timeUnixNano: "1000000" + isMonotonic: true + scope: + name: github.com/open-telemetry/opentelemetry-collector-contrib/receiver/prometheusreceiver + version: v0.116.0-9-g469980bb diff --git a/tests/receivers/envoy/testdata/otlp_exporter.yaml b/tests/receivers/envoy/testdata/otlp_exporter.yaml new file mode 100644 index 0000000000..f3c8ea0b57 --- /dev/null +++ b/tests/receivers/envoy/testdata/otlp_exporter.yaml @@ -0,0 +1,13 @@ +exporters: + otlp: + endpoint: "${OTLP_ENDPOINT}" + tls: + insecure: true + +service: + telemetry: + logs: + level: debug + pipelines: + metrics: + exporters: [otlp] \ No newline at end of file From 739c4d44e561dbf06c23033b2cfab4d4dc028e1c Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 10 Jan 2025 17:05:55 -0800 Subject: [PATCH 2/9] add changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1370ab5154..731c9e5239 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - (Splunk) Add `metricsgeneration` processor ([#5769](https://github.com/signalfx/splunk-otel-collector/pull/5769)) +### 💡 Enhancements 💡 + +- (Splunk) Add a new discovery bundle for Envoy proxy metrics ([#5780](https://github.com/signalfx/splunk-otel-collector/pull/5780)) + ## v0.116.0 This Splunk OpenTelemetry Collector release includes changes from the [opentelemetry-collector v0.116.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.116.0) and the [opentelemetry-collector-contrib v0.116.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.116.0) releases where appropriate. From 417e5dacdfd28660f876ef9de96a122fe90f56fc Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 10 Jan 2025 17:12:18 -0800 Subject: [PATCH 3/9] use correct image, use endpoint instead of hardcoding the port --- .../collector/config.d.linux/receivers/envoy.discovery.yaml | 2 +- .../discovery/bundle/bundle.d/receivers/envoy.discovery.yaml | 2 +- .../bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl | 2 +- tests/receivers/envoy/testdata/expected.yaml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml b/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml index c2d633ab70..bd9b58fb0b 100644 --- a/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml +++ b/cmd/otelcol/config/collector/config.d.linux/receivers/envoy.discovery.yaml @@ -20,7 +20,7 @@ # metrics_path: /stats/prometheus # scrape_interval: 10s # static_configs: -# - targets: ['`host`:9901'] +# - targets: ['`endpoint`'] # metric_relabel_configs: # - source_labels: [__name__] # action: keep diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml index 9555df3474..0197204dad 100644 --- a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml @@ -16,7 +16,7 @@ prometheus: metrics_path: /stats/prometheus scrape_interval: 10s static_configs: - - targets: ['`host`:9901'] + - targets: ['`endpoint`'] metric_relabel_configs: - source_labels: [__name__] action: keep diff --git a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl index 0a1d4a1509..50e41bf1bb 100644 --- a/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl +++ b/internal/confmapprovider/discovery/bundle/bundle.d/receivers/envoy.discovery.yaml.tmpl @@ -12,7 +12,7 @@ metrics_path: /stats/prometheus scrape_interval: 10s static_configs: - - targets: ['`host`:9901'] + - targets: ['`endpoint`'] metric_relabel_configs: - source_labels: [__name__] action: keep diff --git a/tests/receivers/envoy/testdata/expected.yaml b/tests/receivers/envoy/testdata/expected.yaml index 05d8d67eb7..0fb0d5ec6e 100644 --- a/tests/receivers/envoy/testdata/expected.yaml +++ b/tests/receivers/envoy/testdata/expected.yaml @@ -3,7 +3,7 @@ resourceMetrics: attributes: - key: container.image.name value: - stringValue: envoyproxy/envoy + stringValue: quay.io/splunko11ytest/envoy - key: http.scheme value: stringValue: http From c7999fbf470c898e2f4ca05e3709ce4de5b8a7a4 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 10 Jan 2025 22:25:40 -0800 Subject: [PATCH 4/9] do not skip the test --- docker/docker-compose.yml | 6 ++++++ tests/receivers/envoy/bundled_test.go | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 7c8d6ff608..25deba298a 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -87,6 +87,8 @@ services: build: ./envoy ports: - "9901:9901" + networks: + - envoy # Haproxy image for haproxy test: haproxy: image: quay.io/splunko11ytest/haproxy:latest @@ -316,3 +318,7 @@ services: interval: 10s timeout: 5s retries: 5 +networks: + envoy: + driver: bridge + name: envoy diff --git a/tests/receivers/envoy/bundled_test.go b/tests/receivers/envoy/bundled_test.go index 888edc009d..124df52245 100644 --- a/tests/receivers/envoy/bundled_test.go +++ b/tests/receivers/envoy/bundled_test.go @@ -31,7 +31,6 @@ import ( ) func TestEnvoyDockerObserver(t *testing.T) { - t.Skip("Redis data points are also discovered since Redis runs, making this test fail.") testutils.SkipIfNotContainerTest(t) dockerSocket := testutils.CreateDockerSocketProxy(t) require.NoError(t, dockerSocket.Start()) @@ -43,7 +42,9 @@ func TestEnvoyDockerObserver(t *testing.T) { defer tc.PrintLogsOnFailure() defer tc.ShutdownOTLPReceiverSink() _, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(collector testutils.Collector) testutils.Collector { - return collector.WithEnv(map[string]string{ + cc := collector.(*testutils.CollectorContainer) + cc.Container = cc.Container.WithNetworks("envoy").WithNetworkMode("bridge") + return cc.WithEnv(map[string]string{ "SPLUNK_DISCOVERY_DURATION": "20s", "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", }).WithArgs( From 3af3dcbf574267b0389ce927c98536c5eecaf139 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Fri, 10 Jan 2025 23:07:32 -0800 Subject: [PATCH 5/9] fix test --- .../docker_observer_discovery_test.go | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/general/discoverymode/docker_observer_discovery_test.go b/tests/general/discoverymode/docker_observer_discovery_test.go index 2211e7f4cd..e9cb07a125 100644 --- a/tests/general/discoverymode/docker_observer_discovery_test.go +++ b/tests/general/discoverymode/docker_observer_discovery_test.go @@ -188,6 +188,33 @@ func TestDockerObserver(t *testing.T) { "resource_attributes": map[string]any{}, "rule": "type == \"container\" and any([name, image, command], {# matches \"(?i)redis\"}) and not (command matches \"splunk.discovery\")", }, + "prometheus": map[string]any{ + "config": map[string]any{ + "config": map[string]any{ + "scrape_configs": []any{ + map[string]any{ + "job_name": "envoy", + "metric_relabel_configs": []any{ + map[string]any{ + "action": "keep", + "regex": "(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)", + "source_labels": []any{"__name__"}, + }, + }, + "metrics_path": "/stats/prometheus", + "scrape_interval": "10s", + "static_configs": []any{ + map[string]any{ + "targets": []any{"`endpoint`"}, + }, + }, + }, + }, + }, + }, + "resource_attributes": map[string]any{}, + "rule": "type == \"container\" and any([name, image, command], {# matches \"(?i)envoy\"}) and not (command matches \"splunk.discovery\")", + }, }, "watch_observers": []any{"docker_observer"}, }, From 3245d7edbb7425d71866392dc2c75a48b78db9ba Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Sat, 11 Jan 2025 00:10:53 -0800 Subject: [PATCH 6/9] fix test --- .../docker_observer_discovery_test.go | 34 ++++++++++++++++--- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/tests/general/discoverymode/docker_observer_discovery_test.go b/tests/general/discoverymode/docker_observer_discovery_test.go index e9cb07a125..30ebf453a1 100644 --- a/tests/general/discoverymode/docker_observer_discovery_test.go +++ b/tests/general/discoverymode/docker_observer_discovery_test.go @@ -74,10 +74,10 @@ func TestDockerObserver(t *testing.T) { // runner seems to be slow "SPLUNK_DISCOVERY_DURATION": "20s", // confirm that debug logging doesn't affect runtime - "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", - "DOCKER_DOMAIN_SOCKET": fmt.Sprintf("tcp://%s", dockerSocketProxy.ContainerEndpoint), - "LABEL_ONE_VALUE": "actual.label.one.value", - "LABEL_TWO_VALUE": "actual.label.two.value", + //"SPLUNK_DISCOVERY_LOG_LEVEL": "debug", + "DOCKER_DOMAIN_SOCKET": fmt.Sprintf("tcp://%s", dockerSocketProxy.ContainerEndpoint), + "LABEL_ONE_VALUE": "actual.label.one.value", + "LABEL_TWO_VALUE": "actual.label.two.value", "SPLUNK_DISCOVERY_RECEIVERS_prometheus_x5f_simple_CONFIG_labels_x3a__x3a_label_x5f_three": "overwritten by --set property", "SPLUNK_DISCOVERY_RECEIVERS_prometheus_x5f_simple_CONFIG_labels_x3a__x3a_label_x5f_four": "actual.label.four.value", }).WithArgs( @@ -275,6 +275,32 @@ func TestDockerObserver(t *testing.T) { "receivers": map[string]any{ "receiver_creator/discovery": map[string]any{ "receivers": map[string]any{ + "prometheus": map[string]any{ + "config": map[string]any{ + "config": map[string]any{ + "scrape_configs": []any{map[string]any{ + "job_name": "envoy", + "metric_relabel_configs": []any{ + map[string]any{ + "action": "keep", + "regex": "(envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow)", + "source_labels": []any{"__name__"}, + }, + }, + "metrics_path": "/stats/prometheus", + "scrape_interval": "10s", + "static_configs": []any{ + map[string]any{ + "targets": []any{"`endpoint`"}, + }, + }, + }, + }, + }, + }, + "resource_attributes": map[string]any{}, + "rule": "type == \"container\" and any([name, image, command], {# matches \"(?i)envoy\"}) and not (command matches \"splunk.discovery\")", + }, "prometheus_simple": map[string]any{ "config": map[string]any{ "collection_interval": "1s", From edb80c21bdcf15d465904ca98dc903fe4625ab87 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Sat, 11 Jan 2025 00:42:41 -0800 Subject: [PATCH 7/9] fix test --- .../docker_observer_discovery_test.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/general/discoverymode/docker_observer_discovery_test.go b/tests/general/discoverymode/docker_observer_discovery_test.go index 30ebf453a1..c86985bbfb 100644 --- a/tests/general/discoverymode/docker_observer_discovery_test.go +++ b/tests/general/discoverymode/docker_observer_discovery_test.go @@ -357,6 +357,24 @@ processors: receivers: receiver_creator/discovery: receivers: + prometheus: + config: + config: + scrape_configs: + - job_name: envoy + metric_relabel_configs: + - action: keep + regex: (envoy_cluster_upstream_cx_active|envoy_cluster_upstream_cx_total|envoy_cluster_upstream_cx_connect_fail|envoy_cluster_upstream_cx_connect_ms|envoy_cluster_upstream_rq_active|envoy_cluster_upstream_rq_total|envoy_cluster_upstream_rq_timeout|envoy_cluster_upstream_rq_pending_active|envoy_cluster_upstream_rq_pending_overflow|envoy_cluster_upstream_rq_time|envoy_cluster_membership_total|envoy_cluster_membership_degraded|envoy_cluster_membership_excluded|envoy_listener_downstream_cx_active|envoy_listener_downstream_cx_total|envoy_listener_downstream_cx_transport_socket_connect_timeout|envoy_listener_downstream_cx_overflow|envoy_listener_downstream_cx_overload_reject|envoy_listener_downstream_global_cx_overflow) + source_labels: + - __name__ + metrics_path: /stats/prometheus + scrape_interval: 10s + static_configs: + - targets: + - '`+"`endpoint`"+`' + resource_attributes: {} + rule: type == "container" and any([name, image, command], {# matches "(?i)envoy"}) + and not (command matches "splunk.discovery") prometheus_simple: config: collection_interval: 1s From 9aef8d34454552c63590becbe01813879af65ec5 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Sat, 11 Jan 2025 16:41:35 -0800 Subject: [PATCH 8/9] push envoy discovery to its own test --- .github/workflows/integration-test.yml | 2 +- docker/docker-compose.yml | 2 +- tests/receivers/envoy/bundled_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index 1a541bdf23..f60c582416 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -258,7 +258,7 @@ jobs: strategy: matrix: RUNNER: [ "ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04" ] - PROFILE: [ "integration", "smartagent" ] + PROFILE: [ "integration", "smartagent", "envoy_discovery" ] fail-fast: false env: TEST_OUTPUT: ${{ github.job }}-${{ matrix.PROFILE }}-${{ matrix.RUNNER }}.out diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index 25deba298a..d9f442d9d4 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -83,7 +83,7 @@ services: envoy: image: quay.io/splunko11ytest/envoy:latest profiles: - - integration + - envoy_discovery build: ./envoy ports: - "9901:9901" diff --git a/tests/receivers/envoy/bundled_test.go b/tests/receivers/envoy/bundled_test.go index 124df52245..c8c1351ef9 100644 --- a/tests/receivers/envoy/bundled_test.go +++ b/tests/receivers/envoy/bundled_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build integration +//go:build envoy_discovery package tests From 30f57c24d208842c86fe32f6711280605aaaad35 Mon Sep 17 00:00:00 2001 From: Antoine Toulme Date: Sat, 11 Jan 2025 17:53:31 -0800 Subject: [PATCH 9/9] use a separate test run --- .github/workflows/integration-test.yml | 4 ++-- Makefile | 4 ++++ docker/docker-compose.yml | 8 +------- .../discoverymode/docker_observer_discovery_test.go | 8 ++++---- tests/receivers/envoy/bundled_test.go | 3 +-- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/.github/workflows/integration-test.yml b/.github/workflows/integration-test.yml index f60c582416..e81e30d441 100644 --- a/.github/workflows/integration-test.yml +++ b/.github/workflows/integration-test.yml @@ -258,7 +258,7 @@ jobs: strategy: matrix: RUNNER: [ "ubuntu-20.04", "ubuntu-22.04", "ubuntu-24.04" ] - PROFILE: [ "integration", "smartagent", "envoy_discovery" ] + PROFILE: [ "integration", "smartagent" ] fail-fast: false env: TEST_OUTPUT: ${{ github.job }}-${{ matrix.PROFILE }}-${{ matrix.RUNNER }}.out @@ -338,7 +338,7 @@ jobs: id: get-matrix run: | includes="" - for service in "apache" "jmx/cassandra" "kafkametrics" "mongodb" "nginx"; do + for service in "apache" "jmx/cassandra" "kafkametrics" "mongodb" "nginx" "envoy"; do for arch in "amd64" "arm64"; do if [ "$service" = "mongodb" ]; then # tests for mongo "6.0" and "7.0" are flaky, skipping for now diff --git a/Makefile b/Makefile index 18349e2fff..5e240f6ebb 100644 --- a/Makefile +++ b/Makefile @@ -103,6 +103,10 @@ integration-test-jmx/cassandra-discovery: integration-test-apache-discovery: @set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=discovery_integration_apachewebserver -v -timeout 5m -count 1 ./... +.PHONY: integration-test-envoy-discovery +integration-test-envoy-discovery: + @set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=discovery_integration_envoy -v -timeout 5m -count 1 ./... + .PHONY: integration-test-nginx-discovery integration-test-nginx-discovery: @set -e; cd tests && $(GOTEST_SERIAL) $(BUILD_INFO_TESTS) --tags=discovery_integration_nginx -v -timeout 5m -count 1 ./... diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index d9f442d9d4..92c3c86572 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -83,12 +83,10 @@ services: envoy: image: quay.io/splunko11ytest/envoy:latest profiles: - - envoy_discovery + - integration-test-envoy-discovery build: ./envoy ports: - "9901:9901" - networks: - - envoy # Haproxy image for haproxy test: haproxy: image: quay.io/splunko11ytest/haproxy:latest @@ -318,7 +316,3 @@ services: interval: 10s timeout: 5s retries: 5 -networks: - envoy: - driver: bridge - name: envoy diff --git a/tests/general/discoverymode/docker_observer_discovery_test.go b/tests/general/discoverymode/docker_observer_discovery_test.go index c86985bbfb..da5c22c1a7 100644 --- a/tests/general/discoverymode/docker_observer_discovery_test.go +++ b/tests/general/discoverymode/docker_observer_discovery_test.go @@ -74,10 +74,10 @@ func TestDockerObserver(t *testing.T) { // runner seems to be slow "SPLUNK_DISCOVERY_DURATION": "20s", // confirm that debug logging doesn't affect runtime - //"SPLUNK_DISCOVERY_LOG_LEVEL": "debug", - "DOCKER_DOMAIN_SOCKET": fmt.Sprintf("tcp://%s", dockerSocketProxy.ContainerEndpoint), - "LABEL_ONE_VALUE": "actual.label.one.value", - "LABEL_TWO_VALUE": "actual.label.two.value", + "SPLUNK_DISCOVERY_LOG_LEVEL": "debug", + "DOCKER_DOMAIN_SOCKET": fmt.Sprintf("tcp://%s", dockerSocketProxy.ContainerEndpoint), + "LABEL_ONE_VALUE": "actual.label.one.value", + "LABEL_TWO_VALUE": "actual.label.two.value", "SPLUNK_DISCOVERY_RECEIVERS_prometheus_x5f_simple_CONFIG_labels_x3a__x3a_label_x5f_three": "overwritten by --set property", "SPLUNK_DISCOVERY_RECEIVERS_prometheus_x5f_simple_CONFIG_labels_x3a__x3a_label_x5f_four": "actual.label.four.value", }).WithArgs( diff --git a/tests/receivers/envoy/bundled_test.go b/tests/receivers/envoy/bundled_test.go index c8c1351ef9..9cc5b96a71 100644 --- a/tests/receivers/envoy/bundled_test.go +++ b/tests/receivers/envoy/bundled_test.go @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -//go:build envoy_discovery +//go:build discovery_integration_envoy package tests @@ -43,7 +43,6 @@ func TestEnvoyDockerObserver(t *testing.T) { defer tc.ShutdownOTLPReceiverSink() _, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(collector testutils.Collector) testutils.Collector { cc := collector.(*testutils.CollectorContainer) - cc.Container = cc.Container.WithNetworks("envoy").WithNetworkMode("bridge") return cc.WithEnv(map[string]string{ "SPLUNK_DISCOVERY_DURATION": "20s", "SPLUNK_DISCOVERY_LOG_LEVEL": "debug",