Skip to content

Commit

Permalink
Turn on splunk.continuousDiscovery feature gate by default (#5847)
Browse files Browse the repository at this point in the history
* Turn on `splunk.continuousDiscovery` feature gate by default

This enables new way to discover third-party components and collect metrics from them:
  - It allows discovering services that were not available at the time of the collector startup but were started later.
  - Information about discovered services will be sent to Splunk Observability Cloud that can be found in "Discovered services" page.
If you want to disable this feature and bring back the old behavior, add `--feature-gates=-splunk.continuousDiscovery` command line flag.

* Update CHANGELOG.md

Co-authored-by: Antoine Toulme <[email protected]>

---------

Co-authored-by: Antoine Toulme <[email protected]>
  • Loading branch information
dmitryax and atoulme authored Jan 30, 2025
1 parent 109a2ff commit e0d6d05
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 12 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
- `$include:file_path` must be replaced with `${include:file_path}`. The same applied for any other config source.
More information can be found in ([the upgrade guidelines](https://github.com/signalfx/splunk-otel-collector?tab=readme-ov-file#from-01170-to-01180)).

### 💡 Enhancements 💡

- (Splunk) Turn on `splunk.continuousDiscovery` feature gate by default ([#5833](https://github.com/open-telemetry/opentelemetry-collector-contrib/pull/5832))
This enables new way to discover third-party components and collect metrics from them:
- It allows discovering services that were not available at the time of the collector startup but were started later.
- Information about discovered services will be sent to Splunk Observability Cloud that can be found in "Discovered services" page.
If you want to disable this feature and bring back the old behavior, add `--feature-gates=-splunk.continuousDiscovery` command line flag.

## v0.117.0

This Splunk OpenTelemetry Collector release includes changes from the [opentelemetry-collector v0.117.0](https://github.com/open-telemetry/opentelemetry-collector/releases/tag/v0.117.0) and the [opentelemetry-collector-contrib v0.117.0](https://github.com/open-telemetry/opentelemetry-collector-contrib/releases/tag/v0.117.0) releases where appropriate.
Expand Down
2 changes: 1 addition & 1 deletion internal/confmapprovider/discovery/discoverer.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const continuousDiscoveryFGKey = "splunk.continuousDiscovery"

var continuousDiscoveryFG = featuregate.GlobalRegistry().MustRegister(
continuousDiscoveryFGKey,
featuregate.StageAlpha,
featuregate.StageBeta,
featuregate.WithRegisterDescription("When enabled, service discovery will continuously run and collect metrics from discovered services."),
featuregate.WithRegisterFromVersion("v0.109.0"),
)
Expand Down
4 changes: 2 additions & 2 deletions tests/general/discoverymode/docker_observer_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func TestDockerObserver(t *testing.T) {
"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(
"--discovery", "--config-dir", "/opt/config.d",
"--discovery", "--feature-gates=-splunk.continuousDiscovery", "--config-dir", "/opt/config.d",
"--set", `splunk.discovery.extensions.k8s_observer.enabled=false`,
"--set", `splunk.discovery.extensions.docker_observer.enabled=true`,
"--set", `splunk.discovery.extensions.docker_observer.config.endpoint=${DOCKER_DOMAIN_SOCKET}`,
Expand Down Expand Up @@ -282,7 +282,7 @@ SPLUNK_DISCOVERY_EXTENSIONS_docker_observer_CONFIG_endpoint=\${DOCKER_DOMAIN_SOC
SPLUNK_DISCOVERY_RECEIVERS_prometheus_x5f_simple_ENABLED=true \
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" \
/otelcol --config-dir /opt/config.d --discovery --dry-run \
/otelcol --config-dir /opt/config.d --discovery --feature-gates=-splunk.continuousDiscovery --dry-run \
--set splunk.discovery.receivers.prometheus_simple.config.labels::label_three=actual.label.three.value \
--discovery-properties /opt/properties.yaml
`)
Expand Down
4 changes: 2 additions & 2 deletions tests/general/discoverymode/host_observer_discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestHostObserver(t *testing.T) {
"LABEL_ONE_VALUE": "actual.label.one.value.from.env.var",
"LABEL_TWO_VALUE": "actual.label.two.value.from.env.var",
}).WithArgs(
"--discovery",
"--discovery", "--feature-gates=-splunk.continuousDiscovery",
"--config-dir", "/opt/config.d",
"--set", "splunk.discovery.receivers.prometheus_simple.config.labels::label_three=actual.label.three.value.from.cmdline.property",
"--set", "splunk.discovery.extensions.k8s_observer.enabled=false",
Expand Down Expand Up @@ -302,7 +302,7 @@ SPLUNK_DISCOVERY_DURATION=9s \
SPLUNK_DISCOVERY_RECEIVERS_prometheus_simple_CONFIG_labels_x3a__x3a_label_three=actual.label.three.value.from.env.var.property \
SPLUNK_DISCOVERY_EXTENSIONS_k8s_observer_ENABLED=false \
SPLUNK_DISCOVERY_EXTENSIONS_host_observer_CONFIG_refresh_interval=\${REFRESH_INTERVAL} \
/otelcol --config-dir /opt/config.d --discovery --dry-run`)
/otelcol --config-dir /opt/config.d --discovery --feature-gates=-splunk.continuousDiscovery --dry-run`)

errorContent := fmt.Sprintf("unexpected --dry-run: %s", stderr)
require.Equal(t, `exporters:
Expand Down
1 change: 1 addition & 0 deletions tests/receivers/envoy/bundled_k8s_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func TestEnvoyK8sObserver(t *testing.T) {
pmetrictest.IgnoreResourceAttributeValue("service.name"),
pmetrictest.IgnoreResourceAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("service_version"),
pmetrictest.IgnoreResourceAttributeValue("discovery.endpoint.id"),
pmetrictest.IgnoreMetricAttributeValue("service_version"),
pmetrictest.IgnoreMetricAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("server.address"),
Expand Down
2 changes: 1 addition & 1 deletion tests/receivers/envoy/bundled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func TestEnvoyDockerObserver(t *testing.T) {
_, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(collector testutils.Collector) testutils.Collector {
cc := collector.(*testutils.CollectorContainer)
return cc.WithEnv(map[string]string{
"SPLUNK_DISCOVERY_DURATION": "20s",
"SPLUNK_DISCOVERY_LOG_LEVEL": "debug",
}).WithArgs(
"--discovery",
Expand Down Expand Up @@ -72,6 +71,7 @@ func TestEnvoyDockerObserver(t *testing.T) {
pmetrictest.IgnoreResourceAttributeValue("service.name"),
pmetrictest.IgnoreResourceAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("service_version"),
pmetrictest.IgnoreResourceAttributeValue("discovery.endpoint.id"),
pmetrictest.IgnoreMetricAttributeValue("service_version"),
pmetrictest.IgnoreMetricAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("server.address"),
Expand Down
4 changes: 2 additions & 2 deletions tests/receivers/mysql/bundled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,11 @@ func TestMysqlDockerObserver(t *testing.T) {

_, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(c testutils.Collector) testutils.Collector {
cc := c.(*testutils.CollectorContainer)
cc.Container = cc.Container.WillWaitForLogs("Discovering for next")
cc.Container = cc.Container.WillWaitForLogs("Everything is ready")
return cc
},
func(collector testutils.Collector) testutils.Collector {
return collector.WithEnv(map[string]string{
"SPLUNK_DISCOVERY_DURATION": "60s",
"SPLUNK_DISCOVERY_LOG_LEVEL": "debug",
}).WithArgs(
"--discovery",
Expand Down Expand Up @@ -79,6 +78,7 @@ func TestMysqlDockerObserver(t *testing.T) {
pmetrictest.IgnoreResourceAttributeValue("service.name"),
pmetrictest.IgnoreResourceAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("service_version"),
pmetrictest.IgnoreResourceAttributeValue("discovery.endpoint.id"),
pmetrictest.IgnoreMetricAttributeValue("service_version"),
pmetrictest.IgnoreMetricAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("mysql.instance.endpoint"),
Expand Down
3 changes: 1 addition & 2 deletions tests/receivers/oracledb/bundled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ func TestOracledbDockerObserver(t *testing.T) {

_, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(c testutils.Collector) testutils.Collector {
cc := c.(*testutils.CollectorContainer)
cc.Container = cc.Container.WillWaitForLogs("Discovering for next")
cc.Container = cc.Container.WillWaitForLogs("Everything is ready")
return cc
},
func(collector testutils.Collector) testutils.Collector {
return collector.WithEnv(map[string]string{
"SPLUNK_DISCOVERY_DURATION": "20s",
// confirm that debug logging doesn't affect runtime
"SPLUNK_DISCOVERY_LOG_LEVEL": "debug",
"ORACLE_PASSWORD": "password",
Expand Down
4 changes: 2 additions & 2 deletions tests/receivers/redis/bundled_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ func TestRedisDockerObserver(t *testing.T) {

_, shutdown := tc.SplunkOtelCollectorContainer("otlp_exporter.yaml", func(c testutils.Collector) testutils.Collector {
cc := c.(*testutils.CollectorContainer)
cc.Container = cc.Container.WillWaitForLogs("Discovering for next")
cc.Container = cc.Container.WillWaitForLogs("Everything is ready")
return cc
},
func(collector testutils.Collector) testutils.Collector {
Expand All @@ -53,7 +53,6 @@ func TestRedisDockerObserver(t *testing.T) {
"REDIS_USERNAME": "otel",
// confirm that debug logging doesn't affect runtime
"SPLUNK_DISCOVERY_LOG_LEVEL": "debug",
"SPLUNK_DISCOVERY_DURATION": "20s",
}).WithArgs(
"--discovery",
"--set", "splunk.discovery.receivers.redis.config.password=${REDIS_PASSWORD}",
Expand Down Expand Up @@ -81,6 +80,7 @@ func TestRedisDockerObserver(t *testing.T) {
pmetrictest.IgnoreResourceAttributeValue("service.name"),
pmetrictest.IgnoreResourceAttributeValue("service_instance_id"),
pmetrictest.IgnoreResourceAttributeValue("service_version"),
pmetrictest.IgnoreResourceAttributeValue("discovery.endpoint.id"),
pmetrictest.IgnoreMetricAttributeValue("service_version"),
pmetrictest.IgnoreMetricAttributeValue("service_instance_id"),
pmetrictest.IgnoreTimestamp(),
Expand Down

0 comments on commit e0d6d05

Please sign in to comment.