Skip to content

Commit

Permalink
Merge branch 'main' into nikhil/integration-test-poc-final
Browse files Browse the repository at this point in the history
  • Loading branch information
obs-gh-nikhildua committed Aug 27, 2024
2 parents 525ddd2 + c62a44b commit 09573c4
Show file tree
Hide file tree
Showing 10 changed files with 122 additions and 102 deletions.
4 changes: 2 additions & 2 deletions charts/agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: agent
description: Chart to install K8s collection stack based on Observe Agent
type: application
version: 0.5.2
appVersion: "0.11.0"
version: 0.6.0
appVersion: "1.0.0"
dependencies:
- name: opentelemetry-collector
version: 0.101.1
Expand Down
10 changes: 5 additions & 5 deletions charts/agent/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# agent

![Version: 0.5.2](https://img.shields.io/badge/Version-0.5.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.0](https://img.shields.io/badge/AppVersion-0.11.0-informational?style=flat-square)
![Version: 0.6.0](https://img.shields.io/badge/Version-0.6.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.0.0](https://img.shields.io/badge/AppVersion-1.0.0-informational?style=flat-square)

> [!CAUTION]
> This chart is under active development and is not meant to be installed yet.
Expand Down Expand Up @@ -80,7 +80,7 @@ Chart to install K8s collection stack based on Observe Agent
| daemonset-logs-metrics.extraVolumes[4].name | string | `"hostfs"` | |
| daemonset-logs-metrics.image.pullPolicy | string | `"IfNotPresent"` | |
| daemonset-logs-metrics.image.repository | string | `"observeinc/observe-agent"` | |
| daemonset-logs-metrics.image.tag | string | `"0.11.0"` | |
| daemonset-logs-metrics.image.tag | string | `"1.0.0"` | |
| daemonset-logs-metrics.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| daemonset-logs-metrics.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| daemonset-logs-metrics.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -136,7 +136,7 @@ Chart to install K8s collection stack based on Observe Agent
| deployment-agent-monitor.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| deployment-agent-monitor.image.pullPolicy | string | `"IfNotPresent"` | |
| deployment-agent-monitor.image.repository | string | `"observeinc/observe-agent"` | |
| deployment-agent-monitor.image.tag | string | `"0.11.0"` | |
| deployment-agent-monitor.image.tag | string | `"1.0.0"` | |
| deployment-agent-monitor.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| deployment-agent-monitor.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| deployment-agent-monitor.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -190,7 +190,7 @@ Chart to install K8s collection stack based on Observe Agent
| deployment-cluster-events.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| deployment-cluster-events.image.pullPolicy | string | `"IfNotPresent"` | |
| deployment-cluster-events.image.repository | string | `"observeinc/observe-agent"` | |
| deployment-cluster-events.image.tag | string | `"0.11.0"` | |
| deployment-cluster-events.image.tag | string | `"1.0.0"` | |
| deployment-cluster-events.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| deployment-cluster-events.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| deployment-cluster-events.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down Expand Up @@ -244,7 +244,7 @@ Chart to install K8s collection stack based on Observe Agent
| deployment-cluster-metrics.extraVolumes[0].name | string | `"observe-agent-deployment-config"` | |
| deployment-cluster-metrics.image.pullPolicy | string | `"IfNotPresent"` | |
| deployment-cluster-metrics.image.repository | string | `"observeinc/observe-agent"` | |
| deployment-cluster-metrics.image.tag | string | `"0.11.0"` | |
| deployment-cluster-metrics.image.tag | string | `"1.0.0"` | |
| deployment-cluster-metrics.initContainers[0].env[0].name | string | `"NAMESPACE"` | |
| deployment-cluster-metrics.initContainers[0].env[0].valueFrom.fieldRef.fieldPath | string | `"metadata.namespace"` | |
| deployment-cluster-metrics.initContainers[0].image | string | `"observeinc/kube-cluster-info:v0.11.1"` | |
Expand Down
7 changes: 3 additions & 4 deletions charts/agent/templates/_config-exporters.tpl
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
{{- define "config.exporters.otlphttp.observe.base" -}}
otlphttp/observe/base:
endpoint: "{{ trimSuffix "/" .Values.observe.collectionEndpoint }}/v2/otel"
endpoint: "{{ .Values.observe.collectionEndpoint | toString | trimSuffix "/" }}/v2/otel"
headers:
authorization: "Bearer {{ .Values.observe.token }}"
{{- end -}}

{{- define "config.exporters.otlphttp.observe.entity" -}}
otlphttp/observe/entity:
logs_endpoint: "{{ trimSuffix "/" .Values.observe.collectionEndpoint }}/v1/kubernetes/v1/entity"
logs_endpoint: "{{ .Values.observe.collectionEndpoint | toString | trimSuffix "/" }}/v1/kubernetes/v1/entity"
headers:
authorization: "Bearer {{ .Values.observe.entityToken }}"
{{- end -}}

{{- define "config.exporters.prometheusremotewrite" -}}
prometheusremotewrite:
endpoint: "{{ trimSuffix "/" .Values.observe.collectionEndpoint }}/v1/prometheus"
endpoint: "{{ .Values.observe.collectionEndpoint | toString | trimSuffix "/" }}/v1/prometheus"
headers:
authorization: "Bearer {{ .Values.observe.token }}"
resource_to_telemetry_conversion:
enabled: true # Convert resource attributes to metric labels

{{- end -}}

{{- define "config.exporters.debug" -}}
Expand Down
27 changes: 0 additions & 27 deletions charts/agent/templates/_config-processors.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,6 @@ batch:
{{- define "config.processors.attributes.k8sattributes" -}}
k8sattributes:
extract:
annotations:
- from: pod
key_regex: (.*)
tag_name: $$1
labels:
- from: pod
key_regex: (.*)
tag_name: $$1
metadata:
- k8s.namespace.name
- k8s.deployment.name
Expand All @@ -33,7 +25,6 @@ k8sattributes:
- k8s.node.name
- k8s.pod.name
- k8s.pod.uid
- k8s.pod.start_time
- k8s.cluster.uid
- k8s.node.name
- k8s.node.uid
Expand All @@ -49,24 +40,6 @@ k8sattributes:
- from: connection
{{- end -}}

{{- define "config.processors.attributes.k8sattributes.podcontroller" -}}
k8sattributes/podcontroller:
extract:
metadata:
- k8s.deployment.name
- k8s.statefulset.name
- k8s.replicaset.name
- k8s.daemonset.name
- k8s.cronjob.name
- k8s.job.name
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.name
- from: resource_attribute
name: k8s.namespace.name
{{- end -}}

{{- define "config.processors.attributes.observe_common" -}}
attributes/observe_common:
actions:
Expand Down
74 changes: 66 additions & 8 deletions charts/agent/templates/_daemonset-logs-metrics-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,60 @@ receivers:
collection_interval: 10s
auth_type: 'serviceAccount'
endpoint: '${env:K8S_NODE_NAME}:10250'
node: '${env:K8S_NODE_NAME}'
insecure_skip_verify: true
k8s_api_config:
auth_type: serviceAccount
metric_groups:
- node
- pod
- container
metrics:
# Disable deprecated metrics
k8s.node.cpu.utilization:
enabled: false
k8s.pod.cpu.utilization:
enabled: false
container.cpu.utilization:
enabled: false
# The following metrics are optional and must be enabled manually as per:
# https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/receiver/kubeletstatsreceiver/documentation.md#optional-metrics
container.cpu.usage:
enabled: true
container.uptime:
enabled: true
k8s.container.cpu.node.utilization:
enabled: true
k8s.container.cpu_limit_utilization:
enabled: true
k8s.container.cpu_request_utilization:
enabled: true
k8s.container.memory.node.utilization:
enabled: true
k8s.container.memory_limit_utilization:
enabled: true
k8s.container.memory_request_utilization:
enabled: true
k8s.node.cpu.usage:
enabled: true
k8s.node.uptime:
enabled: true
k8s.pod.cpu.node.utilization:
enabled: true
k8s.pod.cpu.usage:
enabled: true
k8s.pod.cpu_limit_utilization:
enabled: true
k8s.pod.cpu_request_utilization:
enabled: true
k8s.pod.memory.node.utilization:
enabled: true
k8s.pod.memory_limit_utilization:
enabled: true
k8s.pod.memory_request_utilization:
enabled: true
k8s.pod.uptime:
enabled: true

filelog:
exclude: []
Expand Down Expand Up @@ -96,14 +145,19 @@ processors:
{{- include "config.processors.attributes.observe_common" . | nindent 2 }}

# attributes to append to objects
attributes/debug_objectSource_pod_logs:
attributes/debug_source_pod_logs:
actions:
- key: debug_objectSource
- key: debug_source
action: insert
value: pod_logs
attributes/debug_objectSource_kublet_metrics:
attributes/debug_source_hostmetrics:
actions:
- key: debug_objectSource
- key: debug_source
action: insert
value: hostmetrics
attributes/debug_source_kubletstats_metrics:
actions:
- key: debug_source
action: insert
value: kubeletstats_metrics

Expand All @@ -112,11 +166,15 @@ service:
pipelines:
logs:
receivers: [filelog]
processors: [memory_limiter, batch, resourcedetection/cloud, k8sattributes, attributes/observe_common, attributes/debug_objectSource_pod_logs]
processors: [memory_limiter, batch, resourcedetection/cloud, k8sattributes, attributes/observe_common, attributes/debug_source_pod_logs]
exporters: [otlphttp/observe/base, debug/override]
metrics:
receivers: [hostmetrics, kubeletstats]
processors: [memory_limiter, batch, resourcedetection/cloud, k8sattributes, attributes/observe_common, attributes/debug_objectSource_kublet_metrics]
hostmetrics:
receivers: [hostmetrics]
processors: [memory_limiter, batch, resourcedetection/cloud, k8sattributes, attributes/observe_common, attributes/debug_source_hostmetrics]
exporters: [prometheusremotewrite, debug/override]
kubeletstatsmetrics:
receivers: [kubeletstats]
processors: [memory_limiter, batch, resourcedetection/cloud, k8sattributes, attributes/observe_common, attributes/debug_source_kubletstats_metrics]
exporters: [prometheusremotewrite, debug/override]

{{- include "config.service.telemetry" . | nindent 2 }}
Expand Down
8 changes: 3 additions & 5 deletions charts/agent/templates/_deployment-agent-monitor-config.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,18 +54,16 @@ receivers:
processors:
{{- include "config.processors.memory_limiter" . | nindent 2 }}

{{- include "config.processors.resource_detection.cloud" . | nindent 2 }}

{{- include "config.processors.batch" . | nindent 2 }}

{{- include "config.processors.attributes.k8sattributes" . | nindent 2 }}

{{- include "config.processors.attributes.observe_common" . | nindent 2 }}

# attributes to append to objects
attributes/debug_objectSource_agent_monitor:
attributes/debug_source_agent_monitor:
actions:
- key: debug_objectSource
- key: debug_source
action: insert
value: agent_monitor

Expand All @@ -74,7 +72,7 @@ service:
pipelines:
metrics:
receivers: [prometheus/collector]
processors: [memory_limiter, batch, resourcedetection/cloud, attributes/observe_common, k8sattributes, attributes/debug_objectSource_agent_monitor]
processors: [memory_limiter, batch, attributes/observe_common, k8sattributes, attributes/debug_source_agent_monitor]
exporters: [prometheusremotewrite]
{{- include "config.service.telemetry" . | nindent 2 }}

Expand Down
Loading

0 comments on commit 09573c4

Please sign in to comment.