# mermin-config.hcl
# Logging level
log_level = "info"
# Network interfaces to monitor
discovery "instrument" {
interfaces = ["eth*", "ens*"]
}
# Configure Kubernetes informer and resources to watch
discovery "informer" "k8s" {
# K8s API connection configuration
informers_sync_timeout = "30s" # Sync timeout for initial load
selectors = [
{ kind = "Service" },
{ kind = "Endpoint" },
{ kind = "EndpointSlice" },
{ kind = "Pod" },
{ kind = "ReplicaSet" },
{ kind = "Deployment" },
{ kind = "DaemonSet" },
{ kind = "StatefulSet" },
{ kind = "Job" },
{ kind = "CronJob" },
]
# Owner reference walking configuration
owner_relations = {
max_depth = 5
include_kinds = [] # Empty = include all
exclude_kinds = []
}
}
# Flow attributes configuration (source)
attributes "source" "k8s" {
extract {
metadata = [
"[*].metadata.name",
"[*].metadata.namespace",
"[*].metadata.uid",
]
}
association {
pod = {
sources = [
{
from = "flow", name = "source.ip",
to = ["status.podIP", "status.podIPs[*]"]
}
]
}
service = {
sources = [
{
from = "flow", name = "source.ip",
to = ["spec.clusterIP", "spec.clusterIPs[*]", "spec.externalIPs[*]"]
},
{ from = "flow", name = "source.port", to = ["spec.ports[*].port"] }
]
}
}
}
# Flow attributes configuration (destination)
attributes "destination" "k8s" {
extract {
metadata = [
"[*].metadata.name",
"[*].metadata.namespace",
"[*].metadata.uid",
]
}
association {
pod = {
sources = [
{
from = "flow", name = "destination.ip",
to = ["status.podIP", "status.podIPs[*]"]
}
]
}
service = {
sources = [
{
from = "flow", name = "destination.ip",
to = ["spec.clusterIP", "spec.clusterIPs[*]", "spec.externalIPs[*]"]
},
{ from = "flow", name = "destination.port", to = ["spec.ports[*].port"] }
]
}
}
}
# Flow span configuration
span {
max_record_interval = "60s"
generic_timeout = "30s"
icmp_timeout = "10s"
tcp_timeout = "20s"
tcp_fin_timeout = "5s"
tcp_rst_timeout = "5s"
udp_timeout = "60s"
community_id_seed = 0
}
# OTLP exporter configuration
export "traces" {
otlp = {
endpoint = "http://otel-collector:4317"
protocol = "grpc"
timeout = "10s"
max_batch_size = 512
max_batch_interval = "5s"
max_queue_size = 32768
max_concurrent_exports = 1
max_export_timeout = "10s"
}
}
# HTTP server configuration (health checks)
internal "server" {
enabled = true
listen_address = "0.0.0.0"
port = 8080
}
# Metrics server configuration (Prometheus)
internal "metrics" {
enabled = true
listen_address = "0.0.0.0"
port = 10250
}