diff --git a/apps/otel/otel-rbac.yaml b/apps/otel/otel-rbac.yaml new file mode 100644 index 0000000..cb4e15b --- /dev/null +++ b/apps/otel/otel-rbac.yaml @@ -0,0 +1,24 @@ +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRole +metadata: + name: otel-collector +rules: + - apiGroups: [""] + resources: ["pods", "namespaces", "nodes"] + verbs: ["get", "list", "watch"] + - apiGroups: ["apps"] + resources: ["deployments", "statefulsets", "daemonsets", "replicasets"] + verbs: ["get", "list", "watch"] +--- +apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding +metadata: + name: otel-collector +roleRef: + apiGroup: rbac.authorization.k8s.io + kind: ClusterRole + name: otel-collector +subjects: + - kind: ServiceAccount + name: otel-collector + namespace: otel diff --git a/apps/otel/otel.yaml b/apps/otel/otel.yaml index c2265c2..48c825b 100644 --- a/apps/otel/otel.yaml +++ b/apps/otel/otel.yaml @@ -54,6 +54,15 @@ spec: send_batch_size: 2000 send_batch_max_size: 2000 timeout: 5s + k8sattributes: + extract: + metadata: + - k8s.namespace.name + - k8s.pod.name + - k8s.pod.start_time + - k8s.pod.uid + - k8s.deployment.name + - k8s.node.name exporters: debug: @@ -90,13 +99,13 @@ spec: pipelines: traces: receivers: [otlp] - processors: [memory_limiter, batch] + processors: [k8sattributes, memory_limiter, batch] exporters: [clickhouse] metrics: receivers: [otlp] #[otlp, hostmetrics] - processors: [memory_limiter, batch] + processors: [k8sattributes, memory_limiter, batch] exporters: [debug, clickhouse] logs: receivers: [otlp] - processors: [memory_limiter, batch] + processors: [k8sattributes, memory_limiter, batch] exporters: [clickhouse]