prometheus / prometheus/node_exporter

Collect nf_conntrack_count from every namespace on host

Open
#2,264 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
13.8k
Forks
2.7k
Avg merge
1d 23h
Merged PRs (30d)
8

Description

When running with network namespaces counter in /proc/sys/net/netfilter/nf_conntrack_count showing correct value only for default namespace. Basic logic in linux kernel node_nf_conntrack_entries_limit limit is shared between all namespaces, but with node exporter we can get only nf_conntrack_count from default and we can't see the real sum of all network namespace nf_conntrack_count in kernel

Host operating system: output of uname -a

Any linux host

node_exporter version: output of node_exporter --version
/opt/node_exporter/node_exporter --version
node_exporter, version 0.17.0 (branch: HEAD, revision: f6f6194a436b9a63d0439abc585c76b19a206b21)
  build user:       root@322511e06ced
  build date:       20181130-15:51:33
  go version:       go1.11.2
node_exporter command line flags
/opt/node_exporter/node_exporter --path.procfs /host/proc --path.sysfs /host/sys 
Are you running node_exporter in Docker?

Yes

What did you do that produced an error?

Use namespaces in linux:

# ip net
qrouter-9d52c01b-4fbd-4d19-8ac5-f6d0ecd2a1df (id: 0)
qrouter-154d0d5b-18be-409b-bb15-f8f67c23ecb7 (id: 1)
What did you expect to see?
# HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking.
# TYPE node_nf_conntrack_entries gauge
node_nf_conntrack_entries{namespace="default"} 90733
node_nf_conntrack_entries{namespace="qrouter-9d52c01b-4fbd-4d19-8ac5-f6d0ecd2a1df"} 203342
node_nf_conntrack_entries{namespace="qrouter-154d0d5b-18be-409b-bb15-f8f67c23ecb7"} 506541
What did you see instead?
# HELP node_nf_conntrack_entries Number of currently allocated flow entries for connection tracking.
# TYPE node_nf_conntrack_entries gauge
node_nf_conntrack_entries 90733

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the node_nf_conntrack_entries collector and how it reads /proc/sys/net/netfilter/nf_conntrack_count, then reproduce the namespace setup described in the issue. Verify how network namespaces can be enumerated and how their values are exposed. Done means the metric reports the default and listed namespaces with correct values rather than only the default namespace.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, linux
Domain
observability, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.