Skip to content

Commit

Permalink
refactor: move deployment configmap to helm values
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Sep 6, 2024
1 parent 4c24904 commit 7ef2009
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 116 deletions.
3 changes: 0 additions & 3 deletions .github/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ Additionally, the OpenTelemetry Contrib collector has also been changed to the [
# !(when an older helm open-telemetry repo exists) update the open-telemetry helm repo
helm repo update open-telemetry
# deploy the configuration for the Elastic OpenTelemetry collector distribution
kubectl apply -f configmap-deployment.yaml
# deploy the demo through helm install
helm install -f deployment.yaml my-otel-demo open-telemetry/opentelemetry-demo
```
Expand Down
82 changes: 0 additions & 82 deletions kubernetes/elastic-helm/configmap-deployment.yaml

This file was deleted.

93 changes: 62 additions & 31 deletions kubernetes/elastic-helm/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,6 @@ default:
image:
repository: ghcr.io/elastic/opentelemetry-demo
tag: 1.11.2
envOverrides:
- name: OTEL_SERVICE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.labels['app.kubernetes.io/component']
- name: OTEL_K8S_NAMESPACE
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.namespace
- name: OTEL_K8S_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
- name: OTEL_K8S_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: OTEL_K8S_POD_UID
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.uid
- name: OTEL_RESOURCE_ATTRIBUTES
value: 'service.name=$(OTEL_SERVICE_NAME),service.instance.id=$(OTEL_K8S_POD_UID),service.namespace=opentelemetry-demo,k8s.namespace.name=$(OTEL_K8S_NAMESPACE),k8s.node.name=$(OTEL_K8S_NODE_NAME),k8s.pod.name=$(OTEL_K8S_POD_NAME)'


opentelemetry-collector:
Expand Down Expand Up @@ -59,9 +31,68 @@ opentelemetry-collector:
name: elastic-secret
key: elastic_apm_secret_token

configMap:
create: false
existingName: elastic-otelcol-agent
config:
receivers:
redis: null
exporters:
otlphttp/prometheus: null
opensearch: null
otlp: null
otlp/elastic:
endpoint: ${env:ELASTIC_APM_ENDPOINT}
compression: none
headers:
Authorization: Bearer ${env:ELASTIC_APM_SECRET_TOKEN}
processors:
k8sattributes:
extract:
metadata:
- k8s.namespace.name
- k8s.deployment.name
- k8s.statefulset.name
- k8s.daemonset.name
- k8s.cronjob.name
- k8s.job.name
- k8s.node.name
- k8s.pod.name
- k8s.pod.uid
- k8s.pod.start_time
- container.image.name
- container.image.tag
- k8s.container.name
passthrough: false
pod_association:
- sources:
- from: resource_attribute
name: k8s.pod.ip
- sources:
- from: resource_attribute
name: k8s.pod.uid
- sources:
- from: connection
resource:
attributes:
- key: service.instance.id
from_attribute: k8s.pod.uid
action: insert
- key: deployment.environment
value: "opentelemetry-demo"
action: upsert

service:
pipelines:
traces:
receivers: [otlp]
processors: [k8sattributes, memory_limiter, transform, resource, batch]
exporters: [otlp/elastic, spanmetrics]
metrics:
receivers: [httpcheck/frontendproxy, otlp, spanmetrics]
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [otlp/elastic]
logs:
processors: [k8sattributes, memory_limiter, resource, batch]
exporters: [otlp/elastic]


opensearch:
enabled: false
Expand Down

0 comments on commit 7ef2009

Please sign in to comment.