Skip to content

Instantly share code, notes, and snippets.

@jseiser
Created April 16, 2025 19:33
Show Gist options
  • Save jseiser/8f064367e679dbd4cf1efaf2befacce1 to your computer and use it in GitHub Desktop.
Save jseiser/8f064367e679dbd4cf1efaf2befacce1 to your computer and use it in GitHub Desktop.
logging {
level = "info"
format = "json"
}
otelcol.receiver.otlp "default" {
debug_metrics {
disable_high_cardinality_metrics = true
}
grpc {
endpoint = "0.0.0.0:4317"
include_metadata = true
}
http {
endpoint = "0.0.0.0:4318"
include_metadata = true
}
output {
traces = [otelcol.processor.k8sattributes.default.input]
}
}
otelcol.processor.k8sattributes "default" {
extract {
metadata = [
"k8s.pod.name",
"k8s.pod.uid",
"k8s.deployment.name",
"k8s.node.name",
"k8s.namespace.name",
"k8s.pod.start_time",
"k8s.replicaset.name",
"k8s.replicaset.uid",
"k8s.daemonset.name",
"k8s.daemonset.uid",
"k8s.job.name",
"k8s.job.uid",
"k8s.cronjob.name",
"k8s.statefulset.name",
"k8s.statefulset.uid",
"k8s.container.name",
"container.image.name",
"container.image.tag",
"container.id",
]
label {
from = "pod"
key_regex = "kubernetes.io/(.*)"
tag_name = "$1"
}
}
pod_association {
source {
from = "resource_attribute"
name = "k8s.pod.ip"
}
}
pod_association {
source {
from = "resource_attribute"
name = "k8s.pod.uid"
}
}
pod_association {
source {
from = "connection"
}
}
output {
traces = [otelcol.processor.memory_limiter.default.input]
}
}
otelcol.processor.memory_limiter "default" {
check_interval = "5s"
limit = "512MiB"
output {
traces = [otelcol.processor.attributes.default.input]
}
}
otelcol.processor.attributes "default" {
action {
key = "service.instance.id"
from_attribute = "k8s.pod.uid"
action = "insert"
}
output {
traces = [otelcol.processor.batch.default.input]
}
}
otelcol.processor.batch "default" {
send_batch_size = 16384
send_batch_max_size = 0
timeout = "2s"
output {
traces = [otelcol.exporter.otlp.to_tempo.input]
}
}
otelcol.exporter.otlp "to_tempo" {
client {
endpoint = "tempo-distributed-distributor.tempo.svc.cluster.local:4317"
tls {
insecure = true
insecure_skip_verify = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment