Skip to content

Commit

Permalink
Cilium: add 1.16+ metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
antonipp committed Jan 30, 2025
1 parent a1cebab commit ade1f67
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions cilium/changelog.d/19520.added
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added Cilium 1.16 metrics
3 changes: 3 additions & 0 deletions cilium/datadog_checks/cilium/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,9 @@
'cilium_k8s_workqueue_retries_total': 'k8s.workqueue.retries.total',
'cilium_k8s_workqueue_unfinished_work_seconds': 'k8s.workqueue.unfinished.work.seconds',
'cilium_version': 'version',
# Cilium 1.16+
'cilium_fqdn_selectors': 'fqdn.selectors',
'cilium_identity_label_sources': 'identity.label_sources',
}

OPERATOR_V2_OVERRIDES = {
Expand Down
2 changes: 2 additions & 0 deletions cilium/metadata.csv
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@ cilium.fqdn.active_names,gauge,,item,,"Number of domains inside the DNS cache th
cilium.fqdn.alive_zombie_connections,gauge,,item,,"Number of IPs associated with domains that have expired (by TTL) yet still associated with an active connection (aka zombie), per endpoint. Available in Cilium v1.12+",0,cilium,fdqn alive zombie connections,,
cilium.fqdn.gc_deletions.count,count,,event,,[OpenMetrics V2] Total number of FQDNs cleaned in FQDN garbage collector job.,0,cilium,fdqn total,,
cilium.fqdn.gc_deletions.total,count,,event,,[OpenMetrics V1] Total number of FQDNs cleaned in FQDN garbage collector job.,0,cilium,fdqn total,,
cilium.fqdn.selectors,gauge,,item,,Number of registered ToFQDN selectors. Available in Cilium v1.16+,0,cilium,fdqn selectors,,
cilium.hive.status,gauge,,item,,[OpenMetrics V1 and V2] Counts of health status levels of Hive components,0,cilium,hive status,,
cilium.identity.count,gauge,,unit,,[OpenMetrics V1 and V2] Number of identities allocate.,0,cilium,id count,,
cilium.identity.label_sources,gauge,,item,,Number of identities which contain at least one label from the given label source. Available in Cilium v1.16+,0,cilium,id label sources,,
cilium.ip_addresses.count,gauge,,unit,,[OpenMetrics V1 and V2] Number of allocated ip_addresses,0,cilium,ip count,,
cilium.ipam.capacity,gauge,,event,,[OpenMetrics V1 and V2] Total number of IPs in the IPAM pool labeled by family,0,cilium,ipam capacity,,
cilium.ipam.events.count,count,,event,,[OpenMetrics V2] Number of IPAM events received by action and datapath family type,0,cilium,ipam total,,
Expand Down
6 changes: 6 additions & 0 deletions cilium/tests/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,9 @@
'cilium.k8s_client.rate_limiter_duration.seconds.sum',
'cilium.policy.change.count',
'cilium.services.events.count',
# 1.16+
'cilium.fqdn.selectors',
'cilium.identity.label_sources',
]

AGENT_V1_METRICS = [
Expand Down Expand Up @@ -238,6 +241,9 @@
'cilium.k8s_client.rate_limiter_duration.seconds.sum',
'cilium.policy.change.total',
'cilium.services.events.total',
# 1.16+
'cilium.fqdn.selectors',
'cilium.identity.label_sources',
]

# Some types changed moving from v1 to v2. We keep v2 in the metadata.csv file.
Expand Down
8 changes: 8 additions & 0 deletions cilium/tests/fixtures/agent_metrics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,9 @@ cilium_forward_count_total{direction="INGRESS"} 1.455756e+06
# HELP cilium_fqdn_gc_deletions_total Number of FQDNs that have been cleaned on FQDN Garbage collector job
# TYPE cilium_fqdn_gc_deletions_total counter
cilium_fqdn_gc_deletions_total 0
# HELP cilium_fqdn_selectors Number of registered ToFQDN selectors
# TYPE cilium_fqdn_selectors gauge
cilium_fqdn_selectors 0
# HELP cilium_fqdn_active_names Number of domains inside the DNS cache that have not expired (by TTL), per endpoint
# TYPE cilium_fqdn_active_names gauge
cilium_fqdn_active_names{endpoint="123"} 1
Expand All @@ -593,6 +596,11 @@ cilium_fqdn_alive_zombie_connections{endpoint="123"} 0
# HELP cilium_identity_count Number of identities currently allocated
# TYPE cilium_identity_count gauge
cilium_identity_count 13
# HELP cilium_identity_label_sources Number of identities which contain at least one label of the given label source
# TYPE cilium_identity_label_sources gauge
cilium_identity_label_sources{source="cidr"} 13
cilium_identity_label_sources{source="k8s"} 17
cilium_identity_label_sources{source="reserved"} 44
# HELP cilium_ip_addresses Number of allocated IP addresses
# TYPE cilium_ip_addresses gauge
cilium_ip_addresses{family="ipv4"} 3
Expand Down
3 changes: 3 additions & 0 deletions cilium/tests/legacy/legacy_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@
'cilium.k8s_client.rate_limiter_duration.seconds.sum',
'cilium.policy.change.total',
'cilium.services.events.total',
# 1.16+
'cilium.fqdn.selectors',
'cilium.identity.label_sources',
]

ADDL_AGENT_METRICS = [
Expand Down

0 comments on commit ade1f67

Please sign in to comment.