TritonDataCenter / triton-cmon

The Metric Agent Proxy for Triton's Container Monitor https://github.com/joyent/rfd/blob/master/rfd/0027/README.md
Mozilla Public License 2.0
6 stars 12 forks source link

TRITON-2124 Want cmon to expose CN hostnames in discovery #22

Closed bahamat closed 4 years ago

bahamat commented 4 years ago

This works for me, but I have no idea if this will work for mock cloud, or even how to test it.

$ cmon -i -p coal -g discover | json -H
{
  "cns": [
    {
      "server_uuid": "3d4217aa-9985-4fcd-82df-102eda3fff0e",
      "server_hostname": "headnode"
    },
    {
      "server_uuid": "deec4f3b-38e8-463e-8d6d-d08e3d86e427",
      "server_hostname": "cn1"
    },
    {
      "server_uuid": "55db0aec-9916-4087-9b37-c922a2cb33f1",
      "server_hostname": "cn2"
    },
    {
      "server_uuid": "53f9b8c0-a32e-4569-b901-164fc1ae448b",
      "server_hostname": "cn3"
    }
  ]
}
twhiteman commented 4 years ago

I'm not sure what this change has to do with mock cloud? Are you looking for a way to test it?

bahamat commented 4 years ago

It doesn't relate specifically to mock cloud, but I do see some special handling of gz stuff for mock cloud. I just want to make sure this will still work with it and not break anything. @kusor gave me a pointer to set it up and try it out, so I'm getting started on that.

isaacdavis commented 4 years ago

This looks good to me, pending the the mockcloud vetting.

bahamat commented 4 years ago

With help from @kusor, I got mock cloud set up, and it looks like this is just fine there.

Before this change

$ cmon -i -p coal -g discover | json -H cns
[
  {
    "server_uuid": "564d2b64-8862-278f-6181-cea59c4ec30d"
  }
]

After this change

$ cmon -i -p coal -g discover | json -H cns
[
  {
    "server_uuid": "564d2b64-8862-278f-6181-cea59c4ec30d",
    "server_hostname": "headnode"
  }
]

After setting up mock cloud

$ cmon -i -p coal -g discover | json -H cns
[
  {
    "server_uuid": "564d2b64-8862-278f-6181-cea59c4ec30d",
    "server_hostname": "headnode"
  },
  {
    "server_uuid": "298697d2-edde-4a3e-a921-3758b569621a",
    "server_hostname": "VC298697D2"
  },
  {
    "server_uuid": "33a55038-8383-45d5-9c5a-3e44ca2bebb6",
    "server_hostname": "VC33A55038"
  },
  {
    "server_uuid": "7b2fffab-cc38-4bb0-8713-edb9e97b8aba",
    "server_hostname": "VC7B2FFFAB"
  },
  {
    "server_uuid": "8ee0a055-fb1c-429b-822a-72f8b011405f",
    "server_hostname": "VC8EE0A055"
  },
  {
    "server_uuid": "eb8adc80-4ef1-4e5f-84a0-eb1094a1746d",
    "server_hostname": "VCEB8ADC80"
  }
]
bahamat commented 4 years ago

package.json version now updated.