pcp
[Top] [All Lists]

Re: [pcp] Easy test to distinguish host metrics from container metrics?

To: Richard Wong <richard.wong.com@xxxxxxxxx>
Subject: Re: [pcp] Easy test to distinguish host metrics from container metrics?
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 5 Oct 2015 19:36:56 -0400 (EDT)
Cc: pcp@xxxxxxxxxxx
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <CAP2pTW4Dqv2rdJ1ipKp8UOnCePC3yvfHxjPuG3ABm1=CMWBF-w@xxxxxxxxxxxxxx>
References: <CAP2pTW4Dqv2rdJ1ipKp8UOnCePC3yvfHxjPuG3ABm1=CMWBF-w@xxxxxxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: w5Btn3KvOKIC9NdxYtsxf5mhkA3Y/Q==
Thread-topic: Easy test to distinguish host metrics from container metrics?
Hi Richard,

----- Original Message -----
> Hello,
> 
> I am currently experimenting with the use of the "container" parameter of the
> host specification to request a context from pmwebapi which I can use to
> fetch container metrics.
> 
> Are there any simple or straightforward tests I could try to verify that the
> metrics I get from subsequent fetches are indeed container metrics and not
> host metrics? So far using pmchart, I notice that the values of some metrics
> will be the same given a plain hostspec, a hostspec with a valid container,
> and a hostspec with a container which does not exist.
> 

There is no reliable way to tell - all mechanisms I know of have situations
where they will report the same thing for hosts vs containers.  e.g., some
containers elect to switch off certain container-related things (network
namespace, pid namespace, etc) and client tools will see the same results as
direct host access.

We could add a pmcd.client.container metric which will indicate whether any
context has a container set for it (and which container it is) - not sure if
that would help you out here?  Might be handy in general anyway, to help us
diagnose problems.

cheers.

--
Nathan

<Prev in Thread] Current Thread [Next in Thread>