diff --git a/config/collector.yaml b/config/collector.yaml index 0a0634f..1d33ff5 100644 --- a/config/collector.yaml +++ b/config/collector.yaml @@ -28,23 +28,21 @@ exporters: auth: authenticator: googleclientauth - extensions: health_check: endpoint: ${env:MY_POD_IP}:13133 googleclientauth: - processors: filter/self-metrics: metrics: include: match_type: strict metric_names: - - otelcol_process_uptime - - otelcol_process_memory_rss - - otelcol_grpc_io_client_completed_rpcs - - otelcol_googlecloudmonitoring_point_count + - otelcol_process_uptime + - otelcol_process_memory_rss + - grpc.client.attempt.duration + - googlecloudmonitoring/point_count batch: send_batch_max_size: 200 send_batch_size: 200 @@ -53,27 +51,27 @@ processors: k8sattributes: extract: metadata: - - k8s.namespace.name - - k8s.deployment.name - - k8s.statefulset.name - - k8s.daemonset.name - - k8s.cronjob.name - - k8s.job.name - - k8s.replicaset.name - - k8s.node.name - - k8s.pod.name - - k8s.pod.uid - - k8s.pod.start_time + - k8s.namespace.name + - k8s.deployment.name + - k8s.statefulset.name + - k8s.daemonset.name + - k8s.cronjob.name + - k8s.job.name + - k8s.replicaset.name + - k8s.node.name + - k8s.pod.name + - k8s.pod.uid + - k8s.pod.start_time passthrough: false pod_association: - - sources: - - from: resource_attribute - name: k8s.pod.ip - - sources: - - from: resource_attribute - name: k8s.pod.uid - - sources: - - from: connection + - sources: + - from: resource_attribute + name: k8s.pod.ip + - sources: + - from: resource_attribute + name: k8s.pod.uid + - sources: + - from: connection memory_limiter: check_interval: 1s @@ -82,12 +80,12 @@ processors: metricstransform/self-metrics: transforms: - - action: update - include: otelcol_process_uptime - operations: - - action: add_label - new_label: version - new_value: Google-Cloud-OTLP manifests:0.4.0 OpenTelemetry Collector Built By Google/0.128.0 (linux/amd64) + - action: update + include: otelcol_process_uptime + operations: + - action: add_label + new_label: version + new_value: Google-Cloud-OTLP manifests:0.4.0 OpenTelemetry Collector Built By Google/0.128.0 (linux/amd64) resourcedetection: detectors: [gcp] @@ -95,20 +93,20 @@ processors: transform/collision: metric_statements: - - context: datapoint - statements: - - set(attributes["exported_location"], attributes["location"]) - - delete_key(attributes, "location") - - set(attributes["exported_cluster"], attributes["cluster"]) - - delete_key(attributes, "cluster") - - set(attributes["exported_namespace"], attributes["namespace"]) - - delete_key(attributes, "namespace") - - set(attributes["exported_job"], attributes["job"]) - - delete_key(attributes, "job") - - set(attributes["exported_instance"], attributes["instance"]) - - delete_key(attributes, "instance") - - set(attributes["exported_project_id"], attributes["project_id"]) - - delete_key(attributes, "project_id") + - context: datapoint + statements: + - set(attributes["exported_location"], attributes["location"]) + - delete_key(attributes, "location") + - set(attributes["exported_cluster"], attributes["cluster"]) + - delete_key(attributes, "cluster") + - set(attributes["exported_namespace"], attributes["namespace"]) + - delete_key(attributes, "namespace") + - set(attributes["exported_job"], attributes["job"]) + - delete_key(attributes, "job") + - set(attributes["exported_instance"], attributes["instance"]) + - delete_key(attributes, "instance") + - set(attributes["exported_project_id"], attributes["project_id"]) + - delete_key(attributes, "project_id") # The relative ordering of statements between ReplicaSet & Deployment and Job & CronJob are important. # The ordering of these controllers is decided based on the k8s controller documentation available at @@ -117,28 +115,28 @@ processors: # create pods. transform/aco-gke: metric_statements: - - context: datapoint - statements: - - set(attributes["top_level_controller_type"], "ReplicaSet") where resource.attributes["k8s.replicaset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.replicaset.name"]) where resource.attributes["k8s.replicaset.name"] != nil - - set(attributes["top_level_controller_type"], "Deployment") where resource.attributes["k8s.deployment.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.deployment.name"]) where resource.attributes["k8s.deployment.name"] != nil - - set(attributes["top_level_controller_type"], "DaemonSet") where resource.attributes["k8s.daemonset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.daemonset.name"]) where resource.attributes["k8s.daemonset.name"] != nil - - set(attributes["top_level_controller_type"], "StatefulSet") where resource.attributes["k8s.statefulset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.statefulset.name"]) where resource.attributes["k8s.statefulset.name"] != nil - - set(attributes["top_level_controller_type"], "Job") where resource.attributes["k8s.job.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.job.name"]) where resource.attributes["k8s.job.name"] != nil - - set(attributes["top_level_controller_type"], "CronJob") where resource.attributes["k8s.cronjob.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.cronjob.name"]) where resource.attributes["k8s.cronjob.name"] != nil + - context: datapoint + statements: + - set(attributes["top_level_controller_type"], "ReplicaSet") where resource.attributes["k8s.replicaset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.replicaset.name"]) where resource.attributes["k8s.replicaset.name"] != nil + - set(attributes["top_level_controller_type"], "Deployment") where resource.attributes["k8s.deployment.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.deployment.name"]) where resource.attributes["k8s.deployment.name"] != nil + - set(attributes["top_level_controller_type"], "DaemonSet") where resource.attributes["k8s.daemonset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.daemonset.name"]) where resource.attributes["k8s.daemonset.name"] != nil + - set(attributes["top_level_controller_type"], "StatefulSet") where resource.attributes["k8s.statefulset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.statefulset.name"]) where resource.attributes["k8s.statefulset.name"] != nil + - set(attributes["top_level_controller_type"], "Job") where resource.attributes["k8s.job.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.job.name"]) where resource.attributes["k8s.job.name"] != nil + - set(attributes["top_level_controller_type"], "CronJob") where resource.attributes["k8s.cronjob.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.cronjob.name"]) where resource.attributes["k8s.cronjob.name"] != nil # When sending telemetry to the GCP OTLP endpoint, the gcp.project_id resource attribute is required to be set to your project ID. resource/gcp_project_id: attributes: - - key: gcp.project_id - # MAKE SURE YOU REPLACE THIS WITH YOUR PROJECT ID - value: ${GOOGLE_CLOUD_PROJECT} - action: insert + - key: gcp.project_id + # MAKE SURE YOU REPLACE THIS WITH YOUR PROJECT ID + value: ${GOOGLE_CLOUD_PROJECT} + action: insert # The metricstarttime processor is important to include if you are using the prometheus receiver to ensure the start time is set properly. # It is a no-op otherwise. metricstarttime: @@ -153,8 +151,8 @@ receivers: http: cors: allowed_origins: - - http://* - - https://* + - http://* + - https://* endpoint: ${env:MY_POD_IP}:4318 otlp/self-metrics: protocols: @@ -163,62 +161,62 @@ receivers: service: extensions: - - health_check - - googleclientauth + - health_check + - googleclientauth pipelines: logs: exporters: - - googlecloud + - googlecloud processors: - - k8sattributes - - resourcedetection - - memory_limiter - - batch + - k8sattributes + - resourcedetection + - memory_limiter + - batch receivers: - - otlp + - otlp metrics/otlp: exporters: - - googlemanagedprometheus + - googlemanagedprometheus processors: - - k8sattributes - - memory_limiter - - metricstarttime - - resourcedetection - - transform/collision - - transform/aco-gke - - batch + - k8sattributes + - memory_limiter + - metricstarttime + - resourcedetection + - transform/collision + - transform/aco-gke + - batch receivers: - - otlp + - otlp metrics/self-metrics: exporters: - - googlemanagedprometheus + - googlemanagedprometheus processors: - - filter/self-metrics - - metricstransform/self-metrics - - k8sattributes - - memory_limiter - - resourcedetection - - batch + - filter/self-metrics + - metricstransform/self-metrics + - k8sattributes + - memory_limiter + - resourcedetection + - batch receivers: - - otlp/self-metrics + - otlp/self-metrics traces: exporters: - - otlphttp + - otlphttp processors: - - k8sattributes - - memory_limiter - - resource/gcp_project_id - - resourcedetection - - batch + - k8sattributes + - memory_limiter + - resource/gcp_project_id + - resourcedetection + - batch receivers: - - otlp + - otlp telemetry: logs: encoding: json metrics: readers: - - periodic: - exporter: - otlp: - protocol: grpc - endpoint: ${env:MY_POD_IP}:14317 + - periodic: + exporter: + otlp: + protocol: grpc + endpoint: ${env:MY_POD_IP}:14317 diff --git a/k8s/base/1_configmap.yaml b/k8s/base/1_configmap.yaml index 2423285..1e182ea 100644 --- a/k8s/base/1_configmap.yaml +++ b/k8s/base/1_configmap.yaml @@ -31,23 +31,21 @@ data: auth: authenticator: googleclientauth - extensions: health_check: endpoint: ${env:MY_POD_IP}:13133 googleclientauth: - processors: filter/self-metrics: metrics: include: match_type: strict metric_names: - - otelcol_process_uptime - - otelcol_process_memory_rss - - otelcol_grpc_io_client_completed_rpcs - - otelcol_googlecloudmonitoring_point_count + - otelcol_process_uptime + - otelcol_process_memory_rss + - grpc.client.attempt.duration + - googlecloudmonitoring/point_count batch: send_batch_max_size: 200 send_batch_size: 200 @@ -56,27 +54,27 @@ data: k8sattributes: extract: metadata: - - k8s.namespace.name - - k8s.deployment.name - - k8s.statefulset.name - - k8s.daemonset.name - - k8s.cronjob.name - - k8s.job.name - - k8s.replicaset.name - - k8s.node.name - - k8s.pod.name - - k8s.pod.uid - - k8s.pod.start_time + - k8s.namespace.name + - k8s.deployment.name + - k8s.statefulset.name + - k8s.daemonset.name + - k8s.cronjob.name + - k8s.job.name + - k8s.replicaset.name + - k8s.node.name + - k8s.pod.name + - k8s.pod.uid + - k8s.pod.start_time passthrough: false pod_association: - - sources: - - from: resource_attribute - name: k8s.pod.ip - - sources: - - from: resource_attribute - name: k8s.pod.uid - - sources: - - from: connection + - sources: + - from: resource_attribute + name: k8s.pod.ip + - sources: + - from: resource_attribute + name: k8s.pod.uid + - sources: + - from: connection memory_limiter: check_interval: 1s @@ -85,12 +83,12 @@ data: metricstransform/self-metrics: transforms: - - action: update - include: otelcol_process_uptime - operations: - - action: add_label - new_label: version - new_value: Google-Cloud-OTLP manifests:0.4.0 OpenTelemetry Collector Built By Google/0.128.0 (linux/amd64) + - action: update + include: otelcol_process_uptime + operations: + - action: add_label + new_label: version + new_value: Google-Cloud-OTLP manifests:0.4.0 OpenTelemetry Collector Built By Google/0.128.0 (linux/amd64) resourcedetection: detectors: [gcp] @@ -98,20 +96,20 @@ data: transform/collision: metric_statements: - - context: datapoint - statements: - - set(attributes["exported_location"], attributes["location"]) - - delete_key(attributes, "location") - - set(attributes["exported_cluster"], attributes["cluster"]) - - delete_key(attributes, "cluster") - - set(attributes["exported_namespace"], attributes["namespace"]) - - delete_key(attributes, "namespace") - - set(attributes["exported_job"], attributes["job"]) - - delete_key(attributes, "job") - - set(attributes["exported_instance"], attributes["instance"]) - - delete_key(attributes, "instance") - - set(attributes["exported_project_id"], attributes["project_id"]) - - delete_key(attributes, "project_id") + - context: datapoint + statements: + - set(attributes["exported_location"], attributes["location"]) + - delete_key(attributes, "location") + - set(attributes["exported_cluster"], attributes["cluster"]) + - delete_key(attributes, "cluster") + - set(attributes["exported_namespace"], attributes["namespace"]) + - delete_key(attributes, "namespace") + - set(attributes["exported_job"], attributes["job"]) + - delete_key(attributes, "job") + - set(attributes["exported_instance"], attributes["instance"]) + - delete_key(attributes, "instance") + - set(attributes["exported_project_id"], attributes["project_id"]) + - delete_key(attributes, "project_id") # The relative ordering of statements between ReplicaSet & Deployment and Job & CronJob are important. # The ordering of these controllers is decided based on the k8s controller documentation available at @@ -120,28 +118,28 @@ data: # create pods. transform/aco-gke: metric_statements: - - context: datapoint - statements: - - set(attributes["top_level_controller_type"], "ReplicaSet") where resource.attributes["k8s.replicaset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.replicaset.name"]) where resource.attributes["k8s.replicaset.name"] != nil - - set(attributes["top_level_controller_type"], "Deployment") where resource.attributes["k8s.deployment.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.deployment.name"]) where resource.attributes["k8s.deployment.name"] != nil - - set(attributes["top_level_controller_type"], "DaemonSet") where resource.attributes["k8s.daemonset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.daemonset.name"]) where resource.attributes["k8s.daemonset.name"] != nil - - set(attributes["top_level_controller_type"], "StatefulSet") where resource.attributes["k8s.statefulset.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.statefulset.name"]) where resource.attributes["k8s.statefulset.name"] != nil - - set(attributes["top_level_controller_type"], "Job") where resource.attributes["k8s.job.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.job.name"]) where resource.attributes["k8s.job.name"] != nil - - set(attributes["top_level_controller_type"], "CronJob") where resource.attributes["k8s.cronjob.name"] != nil - - set(attributes["top_level_controller_name"], resource.attributes["k8s.cronjob.name"]) where resource.attributes["k8s.cronjob.name"] != nil + - context: datapoint + statements: + - set(attributes["top_level_controller_type"], "ReplicaSet") where resource.attributes["k8s.replicaset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.replicaset.name"]) where resource.attributes["k8s.replicaset.name"] != nil + - set(attributes["top_level_controller_type"], "Deployment") where resource.attributes["k8s.deployment.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.deployment.name"]) where resource.attributes["k8s.deployment.name"] != nil + - set(attributes["top_level_controller_type"], "DaemonSet") where resource.attributes["k8s.daemonset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.daemonset.name"]) where resource.attributes["k8s.daemonset.name"] != nil + - set(attributes["top_level_controller_type"], "StatefulSet") where resource.attributes["k8s.statefulset.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.statefulset.name"]) where resource.attributes["k8s.statefulset.name"] != nil + - set(attributes["top_level_controller_type"], "Job") where resource.attributes["k8s.job.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.job.name"]) where resource.attributes["k8s.job.name"] != nil + - set(attributes["top_level_controller_type"], "CronJob") where resource.attributes["k8s.cronjob.name"] != nil + - set(attributes["top_level_controller_name"], resource.attributes["k8s.cronjob.name"]) where resource.attributes["k8s.cronjob.name"] != nil # When sending telemetry to the GCP OTLP endpoint, the gcp.project_id resource attribute is required to be set to your project ID. resource/gcp_project_id: attributes: - - key: gcp.project_id - # MAKE SURE YOU REPLACE THIS WITH YOUR PROJECT ID - value: ${GOOGLE_CLOUD_PROJECT} - action: insert + - key: gcp.project_id + # MAKE SURE YOU REPLACE THIS WITH YOUR PROJECT ID + value: ${GOOGLE_CLOUD_PROJECT} + action: insert # The metricstarttime processor is important to include if you are using the prometheus receiver to ensure the start time is set properly. # It is a no-op otherwise. metricstarttime: @@ -156,8 +154,8 @@ data: http: cors: allowed_origins: - - http://* - - https://* + - http://* + - https://* endpoint: ${env:MY_POD_IP}:4318 otlp/self-metrics: protocols: @@ -166,65 +164,65 @@ data: service: extensions: - - health_check - - googleclientauth + - health_check + - googleclientauth pipelines: logs: exporters: - - googlecloud + - googlecloud processors: - - k8sattributes - - resourcedetection - - memory_limiter - - batch + - k8sattributes + - resourcedetection + - memory_limiter + - batch receivers: - - otlp + - otlp metrics/otlp: exporters: - - googlemanagedprometheus + - googlemanagedprometheus processors: - - k8sattributes - - memory_limiter - - metricstarttime - - resourcedetection - - transform/collision - - transform/aco-gke - - batch + - k8sattributes + - memory_limiter + - metricstarttime + - resourcedetection + - transform/collision + - transform/aco-gke + - batch receivers: - - otlp + - otlp metrics/self-metrics: exporters: - - googlemanagedprometheus + - googlemanagedprometheus processors: - - filter/self-metrics - - metricstransform/self-metrics - - k8sattributes - - memory_limiter - - resourcedetection - - batch + - filter/self-metrics + - metricstransform/self-metrics + - k8sattributes + - memory_limiter + - resourcedetection + - batch receivers: - - otlp/self-metrics + - otlp/self-metrics traces: exporters: - - otlphttp + - otlphttp processors: - - k8sattributes - - memory_limiter - - resource/gcp_project_id - - resourcedetection - - batch + - k8sattributes + - memory_limiter + - resource/gcp_project_id + - resourcedetection + - batch receivers: - - otlp + - otlp telemetry: logs: encoding: json metrics: readers: - - periodic: - exporter: - otlp: - protocol: grpc - endpoint: ${env:MY_POD_IP}:14317 + - periodic: + exporter: + otlp: + protocol: grpc + endpoint: ${env:MY_POD_IP}:14317 kind: ConfigMap metadata: creationTimestamp: null diff --git a/k8s/overlays/test/collector.yaml b/k8s/overlays/test/collector.yaml index 8680337..f774f9b 100644 --- a/k8s/overlays/test/collector.yaml +++ b/k8s/overlays/test/collector.yaml @@ -46,8 +46,8 @@ processors: metric_names: - otelcol_process_uptime - otelcol_process_memory_rss - - otelcol_grpc_io_client_completed_rpcs - - otelcol_googlecloudmonitoring_point_count + - grpc.client.attempt.duration + - googlecloudmonitoring/point_count batch: send_batch_max_size: 200 send_batch_size: 200