Skip to content

Commit

Permalink
Make auto-detection of prometheus metrics disabled by default (signal…
Browse files Browse the repository at this point in the history
…fx#163)

Add an additional "autodetect.prometheus" flag to enable automatic prometheus endpoint detection and make it disabled by default.
  • Loading branch information
dmitryax authored Jun 16, 2021
1 parent 01d60f3 commit ee7bdae
Show file tree
Hide file tree
Showing 46 changed files with 89 additions and 63 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## Unreleased

## [0.27.0] - 2021-06-15

### Changed

- BREAKING CHANGE: Auto-detection of prometheus metrics is disabled by default (#163). See
[Upgrade guideline](https://github.com/signalfx/splunk-otel-collector-chart#0264-to-0270)

## [0.26.4] - 2021-06-09

### Fixed
Expand Down
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,20 @@ $ helm install my-splunk-otel-collector \

The [rendered directory](rendered) contains pre-rendered Kubernetes resource manifests.

## Upgrade guidelines

### 0.26.4 to 0.27.0

[#163 Auto-detection of prometheus metrics is disabled by default](https://github.com/signalfx/splunk-otel-collector-chart/pull/163):
If you rely on automatic prometheus endpoints detection to scrape prometheus
metrics from pods in your k8s cluster, make sure to add this configuration to
your values.yaml:

```
autodetect:
prometheus: true
```

## License

[Apache Software License version 2.0](LICENSE).
2 changes: 1 addition & 1 deletion helm-charts/splunk-otel-collector/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: splunk-otel-collector
version: 0.26.4
version: 0.27.0
description: Splunk OpenTelemetry Connector for Kubernetes
icon: https://github.com/signalfx/splunk-otel-collector-chart/tree/main/splunk.png
type: application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@ receivers:
receiver_creator:
watch_observers: [k8s_observer]
receivers:
{{- if .Values.autodetect.prometheus }}
prometheus_simple:
# Enable prometheus scraping for pods with standard prometheus annotations
rule: type == "pod" && annotations["prometheus.io/scrape"] == "true"
config:
metrics_path: '`"prometheus.io/path" in annotations ? annotations["prometheus.io/path"] : "/metrics"`'
endpoint: '`endpoint`:`"prometheus.io/port" in annotations ? annotations["prometheus.io/port"] : 9090`'
{{- end }}

kubeletstats:
collection_interval: 10s
Expand Down
17 changes: 15 additions & 2 deletions helm-charts/splunk-otel-collector/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,21 @@ logsEnabled: true

# environment: production

# Configuration for additional metadata that will be added to all the telemetry
# as extra attributes.
################################################################################
# Optional: Automatic detection of additional metric sources.
# Set autodetect.prometheus=true if you want the otel-collector agent to scrape
# prometheus metrics from pods that have prometheus-style annotations like
# "prometheus.io/scrape"
################################################################################

autodetect:
prometheus: false

################################################################################
# Optional: Configuration for additional metadata that will be added to all the
# telemetry as extra attributes.
################################################################################

extraAttributes:

# Labels that will be collected from k8s pods (in case they are set)
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd-cri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-cri
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-json
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
9 changes: 2 additions & 7 deletions rendered/manifests/agent-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down Expand Up @@ -115,12 +115,7 @@ data:
- targets:
- ${K8S_POD_IP}:8888
receiver_creator:
receivers:
prometheus_simple:
config:
endpoint: '`endpoint`:`"prometheus.io/port" in annotations ? annotations["prometheus.io/port"] : 9090`'
metrics_path: '`"prometheus.io/path" in annotations ? annotations["prometheus.io/path"] : "/metrics"`'
rule: type == "pod" && annotations["prometheus.io/scrape"] == "true"
receivers: null
watch_observers:
- k8s_observer
sapm:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-k8s-cluster-receiver
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
4 changes: 2 additions & 2 deletions rendered/manifests/agent-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
engine: fluentd
Expand All @@ -23,7 +23,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: 6ddcbb95554e7d324790a2c8084e833334368d2003d174f428a7cb492e4940b3
checksum/config: 31d234b57a23c70a286e04dc535276afc4e1bc1d41e99778d1d5ff16d1584800
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-k8s-cluster-receiver
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
spec:
Expand All @@ -24,7 +24,7 @@ spec:
component: otel-k8s-cluster-receiver
release: default
annotations:
checksum/config: 720b87f36e82118d3038288a7cb906967b7f199f4f6bebe429fb6ec7311ed12f
checksum/config: aae6f77ea8e569efa22900b2d41320d11939ff70ab1abab0b9e347f25aedcfbc
spec:
serviceAccountName: default-splunk-otel-collector
containers:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/agent-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
roleRef:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
4 changes: 2 additions & 2 deletions rendered/manifests/gateway-only/deployment-collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
spec:
Expand All @@ -24,7 +24,7 @@ spec:
component: otel-collector
release: default
annotations:
checksum/config: 684037bd096a49fffb5644b90d2160ad48d0773e6268dc856b1d2b6b4110c851
checksum/config: 7cb28f7b6e64bfefab003794453d1f67813eb81e6eb4dfe88be170bf14c6b100
spec:
serviceAccountName: default-splunk-otel-collector
containers:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ metadata:
labels:
app: splunk-otel-collector
component: otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
spec:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/gateway-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
roleRef:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd-cri.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-cri
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd-json.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd-json
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-fluentd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-fluentd
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/configmap-otel-agent.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-otel-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
data:
Expand Down
4 changes: 2 additions & 2 deletions rendered/manifests/logs-only/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector-agent
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
engine: fluentd
Expand All @@ -23,7 +23,7 @@ spec:
app: splunk-otel-collector
release: default
annotations:
checksum/config: 21bc6edfc4ea6c41d9b45d4fd84293b8a5fe5f81c8eaa72fe2828380e374ef6d
checksum/config: 6822bfb810b0bf9d3bbe193397181b3564e866e47ed03e1f2bcfb6f3ec058df5
spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
type: Opaque
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/logs-only/serviceAccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
2 changes: 1 addition & 1 deletion rendered/manifests/metrics-only/clusterRole.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
rules:
Expand Down
2 changes: 1 addition & 1 deletion rendered/manifests/metrics-only/clusterRoleBinding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ metadata:
name: default-splunk-otel-collector
labels:
app: splunk-otel-collector
chart: splunk-otel-collector-0.26.4
chart: splunk-otel-collector-0.27.0
release: default
heritage: Helm
roleRef:
Expand Down
Loading

0 comments on commit ee7bdae

Please sign in to comment.