Skip to content

Commit

Permalink
Expose internal metrics at default localhost:8888 address (#5706)
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
dmitryax authored Dec 13, 2024
1 parent 82168c5 commit 0a7f444
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 17 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 🚩

Expand Down
5 changes: 1 addition & 4 deletions cmd/otelcol/config/collector/agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_.*'
Expand Down Expand Up @@ -166,9 +166,6 @@ exporters:
verbosity: detailed

service:
telemetry:
metrics:
address: "${SPLUNK_LISTEN_INTERFACE}:8888"
extensions: [health_check, http_forwarder, zpages, smartagent]
pipelines:
traces:
Expand Down
5 changes: 1 addition & 4 deletions cmd/otelcol/config/collector/gateway_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_.*'
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 1 addition & 4 deletions cmd/otelcol/fips/config/agent_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_.*'
Expand Down Expand Up @@ -156,9 +156,6 @@ exporters:
verbosity: detailed

service:
telemetry:
metrics:
address: "${SPLUNK_LISTEN_INTERFACE}:8888"
extensions: [health_check, http_forwarder, zpages]
pipelines:
traces:
Expand Down
2 changes: 1 addition & 1 deletion cmd/otelcol/fips/config/gateway_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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_.*'
Expand Down
6 changes: 2 additions & 4 deletions tests/general/default_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"},
},
},
},
Expand All @@ -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{
Expand Down Expand Up @@ -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"},
},
},
},
Expand All @@ -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{
Expand Down

0 comments on commit 0a7f444

Please sign in to comment.