On 03/10/2016 03:48 AM, Frank Ch. Eigler wrote:
mgoodwin wrote:
[...] So I'm proposing to add the above putenv call to
__pmEndOptions() so that global derived metrics will be loaded by
default for all client tools (but not overriding $PCP_DERIVED_CONFIG
if it's already set). This is a libpcp change, but not an API
change. [...]
That will only affect those tools that opt into the *Options
machinery.
yes quite right, __pmEndOptions() isn't quite global enough
If the goal is to let apprx all tools take advantage of a
systemwide default library of derived metrics, why not do that directly?
For example, set a default PCP_DERIVED_CONFIG=/etc/pcp/derived.d/ via
pcp.conf or libpcp, and just do load it every time, the same way as
the recent changes did for the event.flags / event.missed anonymous
metrics?
I ended up doing similar to event.{flags,missed} in __dminit() and
Nathan briefly rv'd the patch, i.e. load $PCP_VAR_DIR/config/derived
if PCP_DERIVED_CONFIG isn't set. See 5d562064541 in my master branch
at git://git.pcp.io/mgoodwin/pcp
But perhaps I should have just added PCP_DERIVED_CONFIG to pcp.conf,
(in which case 5d562064541 would still be OK but kind of redundant,
so I would probably revert it)
Also, I chose $PCP_VAR_DIR/config/derived to be alongside similar config
directories (pmchart, pmlogconf, pmlogger, pmie and others).
And I guess it probably should be derived.d for ansible and friends?
(and all those other config dirs be renamed too, which sounds like a QA
nightmare!!)
Regards
-- Mark
|