Skip to content

Commit 0a7f444

Browse files
authored
Expose internal metrics at default localhost:8888 address (#5706)
Expose internal metrics at default `localhost:8888` address instead of `${SPLUNK_LISTEN_INTERFACE}:8888` This can be changed by changing default values 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`.
1 parent 82168c5 commit 0a7f444

File tree

6 files changed

+20
-17
lines changed

6 files changed

+20
-17
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,20 @@
66

77
- (Splunk) Automatic Discovery:
88
- 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))
9+
- (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))
10+
This can be changed in `service::telemetry::metrics` section:
11+
```yaml
12+
service:
13+
telemetry:
14+
metrics:
15+
readers:
16+
- pull:
17+
exporter:
18+
prometheus:
19+
host: localhost
20+
port: 8888
21+
```
22+
This also removes a warning about deprecated `service::telemetry::metrics::address`.
923

1024
### 🚩Deprecations 🚩
1125

cmd/otelcol/config/collector/agent_config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ receivers:
7171
- job_name: 'otel-collector'
7272
scrape_interval: 10s
7373
static_configs:
74-
- targets: ["${SPLUNK_LISTEN_INTERFACE}:8888"]
74+
- targets: ["0.0.0.0:8888"]
7575
metric_relabel_configs:
7676
- source_labels: [ __name__ ]
7777
regex: 'otelcol_rpc_.*'
@@ -166,9 +166,6 @@ exporters:
166166
verbosity: detailed
167167

168168
service:
169-
telemetry:
170-
metrics:
171-
address: "${SPLUNK_LISTEN_INTERFACE}:8888"
172169
extensions: [health_check, http_forwarder, zpages, smartagent]
173170
pipelines:
174171
traces:

cmd/otelcol/config/collector/gateway_config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ receivers:
3737
- job_name: 'otel-collector'
3838
scrape_interval: 10s
3939
static_configs:
40-
- targets: ['${SPLUNK_LISTEN_INTERFACE}:8888']
40+
- targets: ['0.0.0.0:8888']
4141
metric_relabel_configs:
4242
- source_labels: [ __name__ ]
4343
regex: 'otelcol_rpc_.*'
@@ -127,9 +127,6 @@ exporters:
127127
log_data_enabled: false
128128

129129
service:
130-
telemetry:
131-
metrics:
132-
address: "${SPLUNK_LISTEN_INTERFACE}:8888"
133130
extensions: [health_check, http_forwarder, zpages]
134131
pipelines:
135132
traces:

cmd/otelcol/fips/config/agent_config.yaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ receivers:
6565
- job_name: 'otel-collector'
6666
scrape_interval: 10s
6767
static_configs:
68-
- targets: ["${SPLUNK_LISTEN_INTERFACE}:8888"]
68+
- targets: ["0.0.0.0:8888"]
6969
metric_relabel_configs:
7070
- source_labels: [ __name__ ]
7171
regex: 'otelcol_rpc_.*'
@@ -156,9 +156,6 @@ exporters:
156156
verbosity: detailed
157157

158158
service:
159-
telemetry:
160-
metrics:
161-
address: "${SPLUNK_LISTEN_INTERFACE}:8888"
162159
extensions: [health_check, http_forwarder, zpages]
163160
pipelines:
164161
traces:

cmd/otelcol/fips/config/gateway_config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ receivers:
3737
- job_name: 'otel-collector'
3838
scrape_interval: 10s
3939
static_configs:
40-
- targets: ['${SPLUNK_LISTEN_INTERFACE}:8888']
40+
- targets: ['0.0.0.0:8888']
4141
metric_relabel_configs:
4242
- source_labels: [ __name__ ]
4343
regex: 'otelcol_rpc_.*'

tests/general/default_config_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ func TestDefaultGatewayConfig(t *testing.T) {
159159
"scrape_interval": "10s",
160160
"static_configs": []any{
161161
map[string]any{
162-
"targets": []any{fmt.Sprintf("%s:8888", ip)},
162+
"targets": []any{"0.0.0.0:8888"},
163163
},
164164
},
165165
},
@@ -177,7 +177,6 @@ func TestDefaultGatewayConfig(t *testing.T) {
177177
},
178178
},
179179
"service": map[string]any{
180-
"telemetry": map[string]any{"metrics": map[string]any{"address": fmt.Sprintf("%s:8888", ip)}},
181180
"extensions": []any{"health_check", "http_forwarder", "zpages"},
182181
"pipelines": map[string]any{
183182
"logs": map[string]any{
@@ -369,7 +368,7 @@ func TestDefaultAgentConfig(t *testing.T) {
369368
"scrape_interval": "10s",
370369
"static_configs": []any{
371370
map[string]any{
372-
"targets": []any{fmt.Sprintf("%s:8888", ip)},
371+
"targets": []any{"0.0.0.0:8888"},
373372
},
374373
},
375374
},
@@ -382,7 +381,6 @@ func TestDefaultAgentConfig(t *testing.T) {
382381
"nop": nil,
383382
},
384383
"service": map[string]any{
385-
"telemetry": map[string]any{"metrics": map[string]any{"address": fmt.Sprintf("%s:8888", ip)}},
386384
"extensions": []any{"health_check", "http_forwarder", "zpages", "smartagent"},
387385
"pipelines": map[string]any{
388386
"logs": map[string]any{

0 commit comments

Comments
 (0)