Amazon-ecs-agent: Can not acquire network metric in EC 2/Bridge mode

Created on 7 Mar 2019  路  3Comments  路  Source: aws/amazon-ecs-agent

Summary

With #1743 merged in v1.24.0, network metrics can not be acquired in EC2/Bridge mode.

Description

1743 changed Stats struct from github.com/fsouza/go-dockerclient to github.com/docker/docker/api/types, but in EC2/Bridge mode network metrics I can not acquire it.

Before:

root@ebb5c8c90634:/# curl -s ${ECS_CONTAINER_METADATA_URI}/stats | jq .networks
{
  "eth0": {
    "rx_bytes": 17331985,
    "tx_packets": 932,
    "rx_packets": 1353,
    "tx_bytes": 77755
  }
}

After:

root@5291861e33b5:/# curl -s ${ECS_CONTAINER_METADATA_URI} | jq .Networks
[
  {
    "NetworkMode": "bridge",
    "IPv4Addresses": [
      "172.17.0.8"
    ]
  }
]

root@5291861e33b5:/# curl -s ${ECS_CONTAINER_METADATA_URI}/stats | jq .networks
null

If you change struct to StatsJSON of github.com/docker/docker/api/types, it seems to solve the problem.

How about that?

kinbug scopECS Agent

Most helpful comment

Hi @hayajo,
Thanks for reporting the issue. I can reproduce this on my end same as what you described. I will mark this as a bug and we will work on implementing a fix for this.

All 3 comments

Hi @hayajo,
Thanks for reporting the issue. I can reproduce this on my end same as what you described. I will mark this as a bug and we will work on implementing a fix for this.

closing - fixed in v1.26.1 release

Thank you! I confirmed that.

Was this page helpful?
0 / 5 - 0 ratings