Skip to content

Commit

Permalink
feat(opentelemetry): add some attributes
Browse files Browse the repository at this point in the history
Signed-off-by: Nicolas Lamirault <[email protected]>
  • Loading branch information
nlamirault committed Mar 3, 2025
1 parent 1a9dc5a commit 8d08011
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ opentelemetry-logs:
fieldPath: spec.nodeName
- name: K8S_CLUSTER_NAME
value: "portefaix-talos-homelab"
- name: K8S_ENVIRONMENT_NAME
value: "homelab"
# - name: OTEL_RESOURCE_ATTRIBUTES
# value: "k8s.cluster.name=$(K8S_CLUSTER_NAME),\
# k8s.pod.ip=$(KUBE_POD_IP),\
# k8s.node.name=$(K8S_NODE_NAME),\
# deployment.environment.name=$(K8S_ENVIRONMENT_NAME)"

opentelemetry-metrics:
extraEnvs:
Expand All @@ -34,6 +41,8 @@ opentelemetry-metrics:
fieldPath: spec.nodeName
- name: K8S_CLUSTER_NAME
value: "portefaix-talos-homelab"
- name: K8S_ENVIRONMENT_NAME
value: "homelab"

opentelemetry-metrics-cluster:
extraEnvs:
Expand All @@ -50,6 +59,8 @@ opentelemetry-metrics-cluster:
fieldPath: spec.nodeName
- name: K8S_CLUSTER_NAME
value: "portefaix-talos-homelab"
- name: K8S_ENVIRONMENT_NAME
value: "homelab"

opentelemetry-traces:
extraEnvs:
Expand All @@ -66,6 +77,8 @@ opentelemetry-traces:
fieldPath: spec.nodeName
- name: K8S_CLUSTER_NAME
value: "portefaix-talos-homelab"
- name: K8S_ENVIRONMENT_NAME
value: "homelab"



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ opentelemetry-logs:
statements:
- set(attributes["k8s.cluster.name"], "${K8S_CLUSTER_NAME}")
- set(attributes["cluster"], "${K8S_CLUSTER_NAME}")
- set(attributes["deployment.environment.name"], "${K8S_ENVIRONMENT_NAME}")
- set(attributes["loki.attribute.labels"], "node, deployment, namespace, container, pod, app")

# redaction/card-numbers:
Expand Down Expand Up @@ -502,6 +503,7 @@ opentelemetry-metrics:
statements:
- set(attributes["k8s.cluster.name"], "${K8S_CLUSTER_NAME}")
- set(attributes["cluster"], "${K8S_CLUSTER_NAME}")
- set(attributes["deployment.environment.name"], "${K8S_ENVIRONMENT_NAME}")

exporters:
otlphttp/gateway:
Expand Down Expand Up @@ -726,6 +728,7 @@ opentelemetry-metrics-cluster:
statements:
- set(attributes["k8s.cluster.name"], "${K8S_CLUSTER_NAME}")
- set(attributes["cluster"], "${K8S_CLUSTER_NAME}")
- set(attributes["deployment.environment.name"], "${K8S_ENVIRONMENT_NAME}")

exporters:
otlphttp/gateway:
Expand Down Expand Up @@ -1171,8 +1174,8 @@ opentelemetry-gateway:
endpoint: http://loki-gateway.logging.svc.cluster.local:80/otlp
# otlphttp/mimir:
# endpoint: http://mimir-gateway.monitoring.svc.cluster.local:80/otlp
otlp/tempo:
endpoint: tempo-distributor.tracing.svc.cluster.local:4317
otlphttp/tempo:
endpoint: http://tempo-distributor.tracing.svc.cluster.local:4318
tls:
insecure: true

Expand Down Expand Up @@ -1246,7 +1249,7 @@ opentelemetry-gateway:
# - otlphttp/kloudmate
- otlphttp/hdx
- otlphttp/oneuptime
- otlp/tempo
- otlphttp/tempo

ports:
otlp:
Expand Down

0 comments on commit 8d08011

Please sign in to comment.