docker / docker/docker-py

[Question] network interfaces

Open
#2,239 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
7.2k
Forks
1.7k
Avg merge
13d 8h
Merged PRs (30d)
2

Description

I try to monitor the network interfaces of my containers, but I don't seem to find a way to match the networks with the statistics.

When I request the network attribute from a container, I get the following information:

"Networks": {
    "homeassistant_homeassistant_default": {
        "IPAMConfig": None,
        "Links": None,
        "Aliases": [
            "home-assistant",
            "2474d497ad47"
        ],
        "NetworkID": "5c35742d633cf58a6c5de9f9f65c76a16bc30426739c6926a40092ec7e753bfe",
        "EndpointID": "aa9a9b2790af3f53b3ae218ea4e245a1656e1153f728116f70deb3793edeb4ee",
        "Gateway": "172.19.0.1",
        "IPAddress": "172.19.0.10",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "MacAddress": "02:42:ac:13:00:0a"
    },
    "web": {
        "IPAMConfig": None,
        "Links": None,
        "Aliases": [
            "home-assistant",
            "2474d497ad47"
        ],
        "NetworkID": "b81adc4a270b3b3318a81a929957a3ca2765fe6f8ba72e882eeeef1059329f1f",
        "EndpointID": "8b9a33e73d235a9729b04b8e9bc4044eda1c1a7b1e150da2a5ef5284b87541af",
        "Gateway": "172.29.0.1",
        "IPAddress": "172.29.0.7",
        "IPPrefixLen": 16,
        "IPv6Gateway": "",
        "GlobalIPv6Address": "",
        "GlobalIPv6PrefixLen": 0,
        "MacAddress": "02:42:ac:1d:00:07"
    }
}

But when I request the network statistics I get the following:


"networks": {
    "eth0": {
        "rx_bytes": 138585375,
        "rx_packets": 771669,
        "rx_errors": 0,
        "rx_dropped": 0,
        "tx_bytes": 323989695,
        "tx_packets": 813381,
        "tx_errors": 0,
        "tx_dropped": 0
    },
    "eth1": {
        "rx_bytes": 4789050,
        "rx_packets": 67862,
        "rx_errors": 0,
        "rx_dropped": 0,
        "tx_bytes": 94635930,
        "tx_packets": 63802,
        "tx_errors": 0,
        "tx_dropped": 0
    }
}

So how can I match ethx with one of the Networks?

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

No source file or test is identified in the issue. Start by comparing the container's network metadata with the Docker Engine API network-statistics response, then determine whether a stable interface-to-network mapping exists; done means documenting the mapping or clearly stating that it cannot be obtained.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, python
Domain
networking
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.