Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[otel-eks-fargate] Document how to use the fleet management feature #493

Merged
merged 5 commits into from
Dec 30, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 33 additions & 8 deletions otel-eks-fargate/cx-eks-fargate-otel-self-monitoring.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,21 @@ data:
observe_pods: true
observe_nodes: true
health_check:
# The OpAMP extension below enables the Coralogix fleet management server connection.
# Uncomment them to enable and add the "opamp" extension to the list under `service.extensions`.
# opamp:
# server:
# http:
# endpoint: "https://ingress.${env:CORALOGIX_DOMAIN}/opamp/v1"
# polling_interval: 2m
# headers:
# Authorization: "Bearer ${env:CORALOGIX_PRIVATE_KEY}"
# agent_description:
# non_identifying_attributes:
# cx.agent.type: "gateway"
# cx.cluster.name: "${env:K8S_CLUSTER_NAME}"
# cx.integrationID: "eks-fargate"
# k8s.node.name: ${env:K8S_NODE_NAME}

receivers:
# Monitor just the missing OTEL collector's kubelet
Expand All @@ -40,6 +55,15 @@ data:
rule: type == "k8s.node" && labels["OTEL-collector-node"] == "true"

processors:
resource/metadata:
attributes:
- key: "k8s.cluster.name"
value: "${env:K8S_CLUSTER_NAME}"
action: upsert
- key: "k8s.node.name"
value: "${env:K8S_NODE_NAME}"
action: upsert

# add cluster name from env variable and EKS metadata
resourcedetection:
detectors: [env, system, eks]
Expand All @@ -52,8 +76,8 @@ data:
exporters:
coralogix:
timeout: "30s"
private_key: "${CORALOGIX_PRIVATE_KEY}"
domain: "${CORALOGIX_DOMAIN}"
private_key: "${env:CORALOGIX_PRIVATE_KEY}"
domain: "${env:CORALOGIX_DOMAIN}"
application_name_attributes:
- "k8s.namespace.name"
- "service.namespace"
Expand All @@ -66,8 +90,8 @@ data:
- "k8s.container.name"
- "k8s.node.name"
- "service.name"
application_name: "${CX_APPLICATION}"
subsystem_name: "${CX_SUBSYSTEM}"
application_name: "${env:CX_APPLICATION}"
subsystem_name: "${env:CX_SUBSYSTEM}"

debug:
verbosity: detailed
Expand All @@ -76,10 +100,11 @@ data:
pipelines:
metrics/colmon:
receivers: [receiver_creator]
processors: [resourcedetection, batch]
processors: [resource/metadata, resourcedetection, batch]
exporters: [coralogix]

extensions: [k8s_observer, health_check]
# When enabling the fleet management feature, add the "opamp" extension to the list below.
extensions: [health_check, k8s_observer]

---

Expand Down Expand Up @@ -118,8 +143,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: OTEL_RESOURCE_ATTRIBUTES
value: "ClusterName=fargate-lab"
- name: K8S_CLUSTER_NAME
value: "fargate-lab"
- name: CORALOGIX_DOMAIN
value: "coralogix.com"
- name: CX_APPLICATION
Expand Down
65 changes: 45 additions & 20 deletions otel-eks-fargate/cx-eks-fargate-otel.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,28 @@ metadata:
component: cx-otel-collector-config
data:
cx-otel-collector-config: |
extensions:
k8s_observer:
auth_type: serviceAccount
observe_pods: true
observe_nodes: true
extensions:
health_check:

k8s_observer:
auth_type: serviceAccount
observe_pods: true
observe_nodes: true
# The OpAMP extension below enables the Coralogix fleet management server connection.
# Uncomment them to enable and add the "opamp" extension to the list under `service.extensions`.
# opamp:
# server:
# http:
# endpoint: "https://ingress.${env:CORALOGIX_DOMAIN}/opamp/v1"
# polling_interval: 2m
# headers:
# Authorization: "Bearer ${env:CORALOGIX_PRIVATE_KEY}"
# agent_description:
# non_identifying_attributes:
# cx.agent.type: "gateway"
# cx.cluster.name: "${env:K8S_CLUSTER_NAME}"
# cx.integrationID: "eks-fargate"
# k8s.node.name: ${env:K8S_NODE_NAME}

receivers:
# Monitoring of OTEL performance metrics
prometheus/self:
Expand Down Expand Up @@ -120,7 +135,16 @@ data:
endpoint: 0.0.0.0:4318

processors:
# add cluster name from env variable and EKS metadata
resource/metadata:
attributes:
- key: "k8s.cluster.name"
value: "${env:K8S_CLUSTER_NAME}"
action: upsert
- key: "k8s.node.name"
value: "${env:K8S_NODE_NAME}"
action: upsert

# add EKS metadata
resourcedetection:
detectors: [env, system, eks]
system:
Expand All @@ -131,14 +155,14 @@ data:

exporters:
prometheusremotewrite:
endpoint: https://ingress.${CORALOGIX_DOMAIN}/prometheus/v1
endpoint: https://ingress.${env:CORALOGIX_DOMAIN}/prometheus/v1
headers:
Authorization: "Bearer ${CORALOGIX_PRIVATE_KEY}"
Authorization: "Bearer ${env:CORALOGIX_PRIVATE_KEY}"

coralogix:
timeout: "30s"
private_key: "${CORALOGIX_PRIVATE_KEY}"
domain: "${CORALOGIX_DOMAIN}"
private_key: "${env:CORALOGIX_PRIVATE_KEY}"
domain: "${env:CORALOGIX_DOMAIN}"
application_name_attributes:
- "k8s.namespace.name"
- "service.namespace"
Expand All @@ -151,8 +175,8 @@ data:
- "k8s.container.name"
- "k8s.node.name"
- "service.name"
application_name: "${CX_APPLICATION}"
subsystem_name: "${CX_SUBSYSTEM}"
application_name: "${env:CX_APPLICATION}"
subsystem_name: "${env:CX_SUBSYSTEM}"

debug:
verbosity: detailed
Expand All @@ -161,21 +185,22 @@ data:
pipelines:
traces:
receivers: [otlp]
processors: [resourcedetection, batch]
processors: [resource/metadata, resourcedetection, batch]
exporters: [coralogix]
metrics/otlp:
receivers: [otlp]
processors: [resourcedetection, batch]
processors: [resource/metadata, resourcedetection, batch]
exporters: [coralogix]
metrics/self:
receivers: [prometheus/self]
processors: [resourcedetection, batch]
processors: [resource/metadata, resourcedetection, batch]
exporters: [prometheusremotewrite]
metrics/kubeletstats:
receivers: [receiver_creator]
processors: [resourcedetection, batch]
processors: [resource/metadata, resourcedetection, batch]
exporters: [coralogix]


# When enabling the fleet management feature, add the "opamp" extension to the list below.
extensions: [health_check, k8s_observer]

# configure the service and the collector as a StatefulSet
Expand Down Expand Up @@ -246,8 +271,8 @@ spec:
valueFrom:
fieldRef:
fieldPath: spec.nodeName
- name: OTEL_RESOURCE_ATTRIBUTES
value: "ClusterName=fargate-lab"
- name: K8S_CLUSTER_NAME
value: "fargate-lab"
- name: CORALOGIX_DOMAIN
value: "coralogix.com"
- name: CX_APPLICATION
Expand Down
Loading