Skip to content

Commit

Permalink
[otel-integration] Add k8s attributes to otel collector gateway
Browse files Browse the repository at this point in the history
  • Loading branch information
povilasv committed Jun 26, 2024
1 parent 19657d3 commit cf872bf
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 2 deletions.
3 changes: 3 additions & 0 deletions otel-integration/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## OpenTelemtry-Integration

### v0.0.82 / 2024-06-26
- [Fix] Add k8s labels to gateway-collector metrics

### v0.0.81 / 2024-06-26
- [Fix] Allow configuring max_unmatched_batch_size in multilineConfigs. Default is changed to max_unmatched_batch_size=1.
- [Fix] Fix spanMetrics.spanNameReplacePattern preset does not work
Expand Down
2 changes: 1 addition & 1 deletion otel-integration/k8s-helm/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: otel-integration
description: OpenTelemetry Integration
version: 0.0.81
version: 0.0.82
keywords:
- OpenTelemetry Collector
- OpenTelemetry Agent
Expand Down
33 changes: 32 additions & 1 deletion otel-integration/k8s-helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ global:
defaultSubsystemName: "integration"
logLevel: "warn"
collectionInterval: "30s"
version: "0.0.81"
version: "0.0.82"

extensions:
kubernetesDashboard:
Expand Down Expand Up @@ -659,6 +659,14 @@ opentelemetry-gateway:
secretKeyRef:
name: coralogix-keys
key: PRIVATE_KEY
- name: KUBE_NODE_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: spec.nodeName
presets:
kubernetesAttributes:
enabled: true

config:
extensions:
Expand Down Expand Up @@ -692,10 +700,31 @@ opentelemetry-gateway:
- "k8s.cronjob.name"
- "service.name"
processors:
# needed for self-monitored otel colector metrics
k8sattributes:
filter:
node_from_env_var: KUBE_NODE_NAME
extract:
metadata:
- "k8s.namespace.name"
# replace the below by `k8s.deployment.name` after https://github.com/open-telemetry/opentelemetry-collector-contrib/issues/23067
- "k8s.replicaset.name"
- "k8s.statefulset.name"
- "k8s.daemonset.name"
- "k8s.cronjob.name"
- "k8s.job.name"
- "k8s.pod.name"
- "k8s.node.name"
batch:
send_batch_size: 1024
send_batch_max_size: 2048
timeout: "1s"
transform/prometheus:
error_mode: ignore
metric_statements:
- context: resource
statements:
- set(attributes["k8s.pod.ip"], attributes["net.host.name"]) where attributes["service.name"] == "opentelemetry-collector"
receivers:
prometheus:
config:
Expand Down Expand Up @@ -728,6 +757,8 @@ opentelemetry-gateway:
exporters:
- coralogix
processors:
- transform/prometheus
- k8sattributes
- memory_limiter
- batch
receivers:
Expand Down

0 comments on commit cf872bf

Please sign in to comment.