Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
jaronoff97 committed Jul 29, 2024
1 parent 8b4d3b4 commit 9853a98
Show file tree
Hide file tree
Showing 5 changed files with 136 additions and 133 deletions.
39 changes: 20 additions & 19 deletions charts/collector-k8s/scrape_configs_ds.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,27 @@
- job_name: otel-collector
scrape_interval: 5s
static_configs:
- labels:
collector_name: ${KUBE_POD_NAME}
targets:
- 0.0.0.0:8888
- labels:
collector_name: ${env:KUBE_POD_NAME}
targets:
- 0.0.0.0:8888
- job_name: apps
kubernetes_sd_configs:
- role: pod
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=$KUBE_NODE_NAME"
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=${env:KUBE_POD_NAME}"
relabel_configs:
# scrape pods annotated with "prometheus.io/scrape: true"
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
regex: "true"
action: keep
# read the port from "prometheus.io/port: <port>" annotation and update scraping address accordingly
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
# escaped $1:$2
replacement: $$1:$$2
# scrape pods annotated with "prometheus.io/scrape: true"
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
regex: "true"
action: keep
# read the port from "prometheus.io/port: <port>" annotation and update scraping address accordingly
- source_labels:
[__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
# escaped $1:$2
replacement: $$1:$$2
6 changes: 3 additions & 3 deletions charts/kube-otel-stack/templates/collector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -115,16 +115,16 @@ spec:
scrape_interval: 5s
static_configs:
- labels:
collector_name: ${OTEL_K8S_POD_NAME}
collector_name: ${env:OTEL_K8S_POD_NAME}
targets:
- ${OTEL_K8S_POD_IP}:8888
- ${env:OTEL_K8S_POD_IP}:8888
{{ end }}
{{- if $collector.targetallocator }}
{{- if $collector.targetallocator.enabled }}
target_allocator:
endpoint: http://{{ $collectorName }}-targetallocator:80
interval: 30s
collector_id: ${OTEL_K8S_POD_NAME}
collector_id: ${env:OTEL_K8S_POD_NAME}
http_sd_config:
refresh_interval: 60s
{{ end }}
Expand Down
6 changes: 3 additions & 3 deletions charts/kube-otel-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ tracesCollector:
name: traces
clusterName: ""

image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
mode: deployment
replicas: 1
hpa:
Expand Down Expand Up @@ -220,7 +220,7 @@ tracesCollector:
metricsCollector:
name: metrics
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
enabled: true
mode: statefulset
replicas: 3
Expand Down Expand Up @@ -348,7 +348,7 @@ metricsCollector:
logsCollector:
name: logs
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
enabled: false
mode: daemonset
resources:
Expand Down
208 changes: 105 additions & 103 deletions charts/otel-cloud-stack/daemon_scrape_configs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
- job_name: kubernetes-pods
scrape_interval: 30s
kubernetes_sd_configs:
- role: pod
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=$K8S_NODE_NAME"
selectors:
- role: pod
# only scrape data from pods running on the same node as collector
field: "spec.nodeName=${env:OTEL_K8S_NODE_NAME}"
relabel_configs:
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape ]
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape]
action: keep
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
- source_labels:
[__meta_kubernetes_pod_annotation_prometheus_io_scrape_slow]
action: drop
regex: true
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_scheme]
Expand All @@ -22,7 +23,8 @@
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
- source_labels:
[__address__, __meta_kubernetes_pod_annotation_prometheus_io_port]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
# NOTE: otel collector uses env var replacement. $$ is used as a literal $.
Expand All @@ -48,18 +50,18 @@
- job_name: node-exporter
scrape_interval: 30s
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
static_configs:
- targets:
- ${K8S_NODE_NAME}:9100
- ${env:K8S_NODE_IP}:9100
# We still need to scrape kubelet's CAdvisor which isn't supported
- authorization:
credentials_file: "/var/run/secrets/kubernetes.io/serviceaccount/token"
Expand All @@ -69,95 +71,95 @@
honor_timestamps: true
job_name: kubelet
kubernetes_sd_configs:
- follow_redirects: true
role: node
# selectors:
# - role: node
# # only scrape data from pods running on the same node as collector
# field: "metadata.name=$K8S_NODE_NAME"
- follow_redirects: true
role: node
# selectors:
# - role: node
# # only scrape data from pods running on the same node as collector
# field: "metadata.name=${env:OTEL_K8S_NODE_NAME}"
metric_relabel_configs:
- action: drop
regex: container_cpu_(load_average_10s|system_seconds_total|user_seconds_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_fs_(io_current|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_memory_(mapped_file|swap)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_(file_descriptors|tasks_state|threads_max)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_spec.*
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: ".+;"
replacement: "$1"
separator: ";"
source_labels:
- id
- pod
- action: drop
regex: container_cpu_(load_average_10s|system_seconds_total|user_seconds_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_fs_(io_current|reads_merged_total|sector_reads_total|sector_writes_total|writes_merged_total)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_memory_(mapped_file|swap)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_(file_descriptors|tasks_state|threads_max)
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: container_spec.*
replacement: "$1"
separator: ";"
source_labels:
- __name__
- action: drop
regex: ".+;"
replacement: "$1"
separator: ";"
source_labels:
- id
- pod
metrics_path: "/metrics/cadvisor"
relabel_configs:
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
- action: replace
replacement: "kubelet"
target_label: job
- action: replace
regex: "(.*)"
replacement: "${1}"
separator: ";"
source_labels:
- __meta_kubernetes_node_name
target_label: node
- action: replace
regex: "(.*)"
replacement: https-metrics
separator: ";"
target_label: endpoint
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __metrics_path__
target_label: metrics_path
- action: hashmod
modulus: 1
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __address__
target_label: __tmp_hash
- action: keep
regex: "$(SHARD)"
replacement: "$1"
separator: ";"
source_labels:
- __tmp_hash
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- job
target_label: __tmp_prometheus_job_name
- action: replace
replacement: "kubelet"
target_label: job
- action: replace
regex: "(.*)"
replacement: "${1}"
separator: ";"
source_labels:
- __meta_kubernetes_node_name
target_label: node
- action: replace
regex: "(.*)"
replacement: https-metrics
separator: ";"
target_label: endpoint
- action: replace
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __metrics_path__
target_label: metrics_path
- action: hashmod
modulus: 1
regex: "(.*)"
replacement: "$1"
separator: ";"
source_labels:
- __address__
target_label: __tmp_hash
- action: keep
regex: "$(SHARD)"
replacement: "$1"
separator: ";"
source_labels:
- __tmp_hash
scheme: https
scrape_interval: 15s
scrape_timeout: 10s
Expand Down
10 changes: 5 additions & 5 deletions charts/otel-cloud-stack/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ autoinstrumentation:
daemonCollector:
name: daemon
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
enabled: true
mode: daemonset
mountHostFS: true
Expand Down Expand Up @@ -305,7 +305,7 @@ daemonCollector:
clusterCollector:
name: cluster-stats
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
replicas: 1
mode: deployment
enabled: true
Expand Down Expand Up @@ -426,7 +426,7 @@ tracesCollector:
enabled: false
name: traces
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
mode: deployment
hpa:
minReplicas: 1
Expand Down Expand Up @@ -542,7 +542,7 @@ logsCollector:
enabled: false
name: logs
clusterName: ""
image: otel/opentelemetry-collector-contrib:0.103.0
image: otel/opentelemetry-collector-contrib:0.105.0
mode: daemonset
resources:
limits:
Expand Down Expand Up @@ -747,7 +747,7 @@ opAMPBridge:
addManagedLabel: false
image:
repository: ghcr.io/open-telemetry/opentelemetry-operator/operator-opamp-bridge
tag: "0.103.0"
tag: "0.104.0"
endpoint: "wss://opamp.lightstep.com/v1/opamp"
headers:
"Authorization": "bearer ${LS_OPAMP_API_KEY}"
Expand Down

0 comments on commit 9853a98

Please sign in to comment.