mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
Merge branch 'master' of https://github.com/OneUptime/oneuptime
This commit is contained in:
@@ -17,7 +17,7 @@ data:
|
||||
kubeletstats:
|
||||
collection_interval: {{ .Values.collectionInterval }}
|
||||
auth_type: serviceAccount
|
||||
endpoint: "https://${env:NODE_NAME}:10250"
|
||||
endpoint: "https://${env:NODE_IP}:10250"
|
||||
insecure_skip_verify: true
|
||||
metric_groups:
|
||||
- node
|
||||
@@ -130,12 +130,30 @@ data:
|
||||
- sources:
|
||||
- from: connection
|
||||
|
||||
# Stamp with cluster name
|
||||
# Stamp with cluster name and default service name
|
||||
resource:
|
||||
attributes:
|
||||
- key: k8s.cluster.name
|
||||
value: {{ .Values.clusterName | quote }}
|
||||
action: upsert
|
||||
- key: service.name
|
||||
value: "kubernetes-agent-{{ .Values.clusterName }}"
|
||||
action: upsert
|
||||
|
||||
# Set service.name from deployment/statefulset/daemonset name when available
|
||||
transform:
|
||||
log_statements:
|
||||
- context: resource
|
||||
statements:
|
||||
- set(attributes["service.name"], attributes["k8s.deployment.name"]) where attributes["k8s.deployment.name"] != nil and attributes["k8s.deployment.name"] != ""
|
||||
- set(attributes["service.name"], attributes["k8s.statefulset.name"]) where attributes["k8s.statefulset.name"] != nil and attributes["k8s.statefulset.name"] != "" and attributes["k8s.deployment.name"] == nil
|
||||
- set(attributes["service.name"], attributes["k8s.daemonset.name"]) where attributes["k8s.daemonset.name"] != nil and attributes["k8s.daemonset.name"] != "" and attributes["k8s.deployment.name"] == nil and attributes["k8s.statefulset.name"] == nil
|
||||
metric_statements:
|
||||
- context: resource
|
||||
statements:
|
||||
- set(attributes["service.name"], attributes["k8s.deployment.name"]) where attributes["k8s.deployment.name"] != nil and attributes["k8s.deployment.name"] != ""
|
||||
- set(attributes["service.name"], attributes["k8s.statefulset.name"]) where attributes["k8s.statefulset.name"] != nil and attributes["k8s.statefulset.name"] != "" and attributes["k8s.deployment.name"] == nil
|
||||
- set(attributes["service.name"], attributes["k8s.daemonset.name"]) where attributes["k8s.daemonset.name"] != nil and attributes["k8s.daemonset.name"] != "" and attributes["k8s.deployment.name"] == nil and attributes["k8s.statefulset.name"] == nil
|
||||
|
||||
batch:
|
||||
send_batch_size: 1024
|
||||
@@ -163,6 +181,7 @@ data:
|
||||
- memory_limiter
|
||||
- k8sattributes
|
||||
- resource
|
||||
- transform
|
||||
- batch
|
||||
exporters:
|
||||
- otlphttp
|
||||
@@ -173,6 +192,7 @@ data:
|
||||
- memory_limiter
|
||||
- k8sattributes
|
||||
- resource
|
||||
- transform
|
||||
- batch
|
||||
exporters:
|
||||
- otlphttp
|
||||
|
||||
@@ -63,13 +63,28 @@ data:
|
||||
mode: pull
|
||||
interval: {{ .Values.resourceSpecs.interval }}
|
||||
group: batch
|
||||
- name: persistentvolumeclaims
|
||||
mode: pull
|
||||
interval: {{ .Values.resourceSpecs.interval }}
|
||||
- name: persistentvolumes
|
||||
mode: pull
|
||||
interval: {{ .Values.resourceSpecs.interval }}
|
||||
- name: horizontalpodautoscalers
|
||||
mode: pull
|
||||
interval: {{ .Values.resourceSpecs.interval }}
|
||||
group: autoscaling
|
||||
- name: verticalpodautoscalers
|
||||
mode: pull
|
||||
interval: {{ .Values.resourceSpecs.interval }}
|
||||
group: autoscaling.k8s.io
|
||||
{{- end }}
|
||||
|
||||
{{- if .Values.controlPlane.enabled }}
|
||||
# Scrape control plane metrics via Prometheus endpoints
|
||||
{{- if or .Values.controlPlane.enabled .Values.serviceMesh.enabled }}
|
||||
# Scrape metrics via Prometheus endpoints (control plane and/or service mesh)
|
||||
prometheus:
|
||||
config:
|
||||
scrape_configs:
|
||||
{{- if .Values.controlPlane.enabled }}
|
||||
- job_name: etcd
|
||||
scheme: https
|
||||
tls_config:
|
||||
@@ -109,6 +124,53 @@ data:
|
||||
- targets:
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and .Values.serviceMesh.enabled (eq .Values.serviceMesh.provider "istio") }}
|
||||
- job_name: envoy-stats
|
||||
metrics_path: /stats/prometheus
|
||||
scrape_interval: {{ .Values.serviceMesh.istio.scrapeInterval }}
|
||||
kubernetes_sd_configs:
|
||||
- role: pod
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_pod_container_name]
|
||||
action: keep
|
||||
regex: istio-proxy
|
||||
- source_labels: [__meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_ip]
|
||||
action: replace
|
||||
regex: (\d+);((([0-9]+?)(\.|$)){4})
|
||||
replacement: $2:15090
|
||||
target_label: __address__
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_pod_label_(.+)
|
||||
- source_labels: [__meta_kubernetes_namespace]
|
||||
action: replace
|
||||
target_label: namespace
|
||||
- source_labels: [__meta_kubernetes_pod_name]
|
||||
action: replace
|
||||
target_label: pod_name
|
||||
{{- end }}
|
||||
{{- if and .Values.serviceMesh.enabled (eq .Values.serviceMesh.provider "linkerd") }}
|
||||
- job_name: linkerd-proxy
|
||||
metrics_path: /metrics
|
||||
scrape_interval: {{ .Values.serviceMesh.linkerd.scrapeInterval }}
|
||||
kubernetes_sd_configs:
|
||||
- role: pod
|
||||
relabel_configs:
|
||||
- source_labels: [__meta_kubernetes_pod_container_name]
|
||||
action: keep
|
||||
regex: linkerd-proxy
|
||||
- source_labels: [__meta_kubernetes_pod_container_port_name]
|
||||
action: keep
|
||||
regex: linkerd-admin
|
||||
- action: labelmap
|
||||
regex: __meta_kubernetes_pod_label_(.+)
|
||||
- source_labels: [__meta_kubernetes_namespace]
|
||||
action: replace
|
||||
target_label: namespace
|
||||
- source_labels: [__meta_kubernetes_pod_name]
|
||||
action: replace
|
||||
target_label: pod_name
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
processors:
|
||||
@@ -145,12 +207,15 @@ data:
|
||||
- sources:
|
||||
- from: connection
|
||||
|
||||
# Stamp all telemetry with the cluster name
|
||||
# Stamp all telemetry with the cluster name and service name
|
||||
resource:
|
||||
attributes:
|
||||
- key: k8s.cluster.name
|
||||
value: {{ .Values.clusterName | quote }}
|
||||
action: upsert
|
||||
- key: service.name
|
||||
value: "kubernetes-agent-{{ .Values.clusterName }}"
|
||||
action: upsert
|
||||
|
||||
# Batch telemetry for efficient export
|
||||
batch:
|
||||
@@ -187,7 +252,7 @@ data:
|
||||
metrics:
|
||||
receivers:
|
||||
- k8s_cluster
|
||||
{{- if .Values.controlPlane.enabled }}
|
||||
{{- if or .Values.controlPlane.enabled .Values.serviceMesh.enabled }}
|
||||
- prometheus
|
||||
{{- end }}
|
||||
processors:
|
||||
|
||||
@@ -34,6 +34,10 @@ spec:
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: spec.nodeName
|
||||
- name: NODE_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.hostIP
|
||||
- name: ONEUPTIME_API_KEY
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
|
||||
@@ -66,6 +66,24 @@ rules:
|
||||
resources:
|
||||
- events
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["autoscaling.k8s.io"]
|
||||
resources:
|
||||
- verticalpodautoscalers
|
||||
verbs: ["get", "list", "watch"]
|
||||
{{- if and .Values.serviceMesh.enabled (eq .Values.serviceMesh.provider "istio") }}
|
||||
- apiGroups: ["networking.istio.io"]
|
||||
resources:
|
||||
- virtualservices
|
||||
- destinationrules
|
||||
- gateways
|
||||
- serviceentries
|
||||
verbs: ["get", "list", "watch"]
|
||||
- apiGroups: ["security.istio.io"]
|
||||
resources:
|
||||
- peerauthentications
|
||||
- authorizationpolicies
|
||||
verbs: ["get", "list", "watch"]
|
||||
{{- end }}
|
||||
# For kubeletstats receiver
|
||||
- nonResourceURLs:
|
||||
- /metrics
|
||||
|
||||
@@ -80,6 +80,16 @@ resourceSpecs:
|
||||
# Collection intervals
|
||||
collectionInterval: 30s
|
||||
|
||||
# Service mesh observability (Istio / Linkerd sidecar metrics)
|
||||
serviceMesh:
|
||||
enabled: false
|
||||
# Supported providers: "istio", "linkerd"
|
||||
provider: "istio"
|
||||
istio:
|
||||
scrapeInterval: 15s
|
||||
linkerd:
|
||||
scrapeInterval: 15s
|
||||
|
||||
# Service account configuration
|
||||
serviceAccount:
|
||||
create: true
|
||||
|
||||
Reference in New Issue
Block a user