diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a82c29e1c..aa0f24944a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,20 @@ - (Splunk) Automatic Discovery: - Switch bundled NGINX discovery to create [OpenTelemetry NGINX receiver](https://docs.splunk.com/observability/en/gdi/opentelemetry/components/nginx-receiver.html#nginx-receiver) instead of the Smart Agent NGINX monitor ([#5689](https://github.com/signalfx/splunk-otel-collector/pull/5689)) +- (Splunk) Expose internal metrics at default `localhost:8888` address instead of `${SPLUNK_LISTEN_INTERFACE}:8888` ([#5706](https://github.com/signalfx/splunk-otel-collector/pull/5706)) + This can be changed in `service::telemetry::metrics` section: + ```yaml + service: + telemetry: + metrics: + readers: + - pull: + exporter: + prometheus: + host: localhost + port: 8888 + ``` + This also removes a warning about deprecated `service::telemetry::metrics::address`. ### 🚩Deprecations 🚩 diff --git a/cmd/otelcol/config/collector/agent_config.yaml b/cmd/otelcol/config/collector/agent_config.yaml index dd4264997a..00e3bbc08e 100644 --- a/cmd/otelcol/config/collector/agent_config.yaml +++ b/cmd/otelcol/config/collector/agent_config.yaml @@ -71,7 +71,7 @@ receivers: - job_name: 'otel-collector' scrape_interval: 10s static_configs: - - targets: ["${SPLUNK_LISTEN_INTERFACE}:8888"] + - targets: ["0.0.0.0:8888"] metric_relabel_configs: - source_labels: [ __name__ ] regex: 'otelcol_rpc_.*' @@ -166,9 +166,6 @@ exporters: verbosity: detailed service: - telemetry: - metrics: - address: "${SPLUNK_LISTEN_INTERFACE}:8888" extensions: [health_check, http_forwarder, zpages, smartagent] pipelines: traces: diff --git a/cmd/otelcol/config/collector/gateway_config.yaml b/cmd/otelcol/config/collector/gateway_config.yaml index 662d0fa06a..15231c0390 100644 --- a/cmd/otelcol/config/collector/gateway_config.yaml +++ b/cmd/otelcol/config/collector/gateway_config.yaml @@ -37,7 +37,7 @@ receivers: - job_name: 'otel-collector' scrape_interval: 10s static_configs: - - targets: ['${SPLUNK_LISTEN_INTERFACE}:8888'] + - targets: ['0.0.0.0:8888'] metric_relabel_configs: - source_labels: [ __name__ ] regex: 'otelcol_rpc_.*' @@ -127,9 +127,6 @@ exporters: log_data_enabled: false service: - telemetry: - metrics: - address: "${SPLUNK_LISTEN_INTERFACE}:8888" extensions: [health_check, http_forwarder, zpages] pipelines: traces: diff --git a/cmd/otelcol/fips/config/agent_config.yaml b/cmd/otelcol/fips/config/agent_config.yaml index 3c5761fc10..6f43ca53fc 100644 --- a/cmd/otelcol/fips/config/agent_config.yaml +++ b/cmd/otelcol/fips/config/agent_config.yaml @@ -65,7 +65,7 @@ receivers: - job_name: 'otel-collector' scrape_interval: 10s static_configs: - - targets: ["${SPLUNK_LISTEN_INTERFACE}:8888"] + - targets: ["0.0.0.0:8888"] metric_relabel_configs: - source_labels: [ __name__ ] regex: 'otelcol_rpc_.*' @@ -156,9 +156,6 @@ exporters: verbosity: detailed service: - telemetry: - metrics: - address: "${SPLUNK_LISTEN_INTERFACE}:8888" extensions: [health_check, http_forwarder, zpages] pipelines: traces: diff --git a/cmd/otelcol/fips/config/gateway_config.yaml b/cmd/otelcol/fips/config/gateway_config.yaml index 391e707fe0..5d004d0af4 100644 --- a/cmd/otelcol/fips/config/gateway_config.yaml +++ b/cmd/otelcol/fips/config/gateway_config.yaml @@ -37,7 +37,7 @@ receivers: - job_name: 'otel-collector' scrape_interval: 10s static_configs: - - targets: ['${SPLUNK_LISTEN_INTERFACE}:8888'] + - targets: ['0.0.0.0:8888'] metric_relabel_configs: - source_labels: [ __name__ ] regex: 'otelcol_rpc_.*' diff --git a/tests/general/default_config_test.go b/tests/general/default_config_test.go index 077b6ff23d..ddbc422ad4 100644 --- a/tests/general/default_config_test.go +++ b/tests/general/default_config_test.go @@ -159,7 +159,7 @@ func TestDefaultGatewayConfig(t *testing.T) { "scrape_interval": "10s", "static_configs": []any{ map[string]any{ - "targets": []any{fmt.Sprintf("%s:8888", ip)}, + "targets": []any{"0.0.0.0:8888"}, }, }, }, @@ -177,7 +177,6 @@ func TestDefaultGatewayConfig(t *testing.T) { }, }, "service": map[string]any{ - "telemetry": map[string]any{"metrics": map[string]any{"address": fmt.Sprintf("%s:8888", ip)}}, "extensions": []any{"health_check", "http_forwarder", "zpages"}, "pipelines": map[string]any{ "logs": map[string]any{ @@ -369,7 +368,7 @@ func TestDefaultAgentConfig(t *testing.T) { "scrape_interval": "10s", "static_configs": []any{ map[string]any{ - "targets": []any{fmt.Sprintf("%s:8888", ip)}, + "targets": []any{"0.0.0.0:8888"}, }, }, }, @@ -382,7 +381,6 @@ func TestDefaultAgentConfig(t *testing.T) { "nop": nil, }, "service": map[string]any{ - "telemetry": map[string]any{"metrics": map[string]any{"address": fmt.Sprintf("%s:8888", ip)}}, "extensions": []any{"health_check", "http_forwarder", "zpages", "smartagent"}, "pipelines": map[string]any{ "logs": map[string]any{