Skip to content

Commit

Permalink
feat: add Elastic distro to Helm deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
rogercoll committed Jul 1, 2024
1 parent a4b8462 commit 4c137f4
Show file tree
Hide file tree
Showing 2 changed files with 125 additions and 32 deletions.
108 changes: 108 additions & 0 deletions kubernetes/elastic-helm/configmap-elastic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
# Source: opentelemetry-demo/charts/opentelemetry-collector/templates/configmap-agent.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: elastic-otelcol-agent
namespace: default
labels:
app.kubernetes.io/name: otelcol

data:
relay: |
connectors:
spanmetrics: {}
exporters:
debug: {}
otlp/elastic:
endpoint: ${ELASTIC_APM_ENDPOINT}
compression: none
headers:
Authorization: ApiKey ${ELASTIC_APM_SECRET_TOKEN}
extensions:
processors:
batch: {}
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
filter:
node_from_env_var: K8S_NODE_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:
- action: insert
from_attribute: k8s.pod.uid
key: service.instance.id
receivers:
httpcheck/frontendproxy:
targets:
- endpoint: http://example-frontendproxy:8080
otlp:
protocols:
grpc:
endpoint: ${env:MY_POD_IP}:4317
http:
cors:
allowed_origins:
- http://*
- https://*
endpoint: ${env:MY_POD_IP}:4318
service:
extensions:
pipelines:
logs:
exporters:
- debug
- otlp/elastic
processors:
- k8sattributes
- resource
- batch
receivers:
- otlp
metrics:
exporters:
- otlp/elastic
- debug
processors:
- k8sattributes
- resource
- batch
receivers:
- httpcheck/frontendproxy
- otlp
- spanmetrics
traces:
exporters:
- otlp/elastic
- debug
- spanmetrics
processors:
- k8sattributes
- resource
- batch
receivers:
- otlp
telemetry:
metrics:
address: ${env:MY_POD_IP}:8888
49 changes: 17 additions & 32 deletions kubernetes/elastic-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,38 +24,23 @@ opentelemetry-collector:
secretKeyRef:
name: elastic-secret
key: elastic_apm_secret_token
config:
exporters:
otlp/elastic:
endpoint: ${ELASTIC_APM_ENDPOINT}
compression: none
headers:
Authorization: Bearer ${ELASTIC_APM_SECRET_TOKEN}
receivers:
otlp:
protocols:
grpc:
endpoint: ${MY_POD_IP}:4317
http:
cors:
allowed_origins:
- http://*
- https://*
endpoint: ${MY_POD_IP}:4318
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [otlp/elastic]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [otlp/elastic]
logs:
receivers: [otlp]
processors: [batch]
exporters: [otlp/elastic]

configMap:
create: false
existingName: elastic-otelcol-agent

livenessProbe:
httpGet:
port: 8888
path: metrics
readinessProbe:
httpGet:
port: 8888
path: metrics

opensearch:
enabled: false

grafana:
enabled: false

Expand Down

0 comments on commit 4c137f4

Please sign in to comment.