Hi
I want to know if it is possible to reduce the time between metric collections.
I found in the metric collector worker creation that the 5 minute period can be overwritten defining config.Period but I don’t know how to set that.
I tried to put the period config variable in the config.yml of the charm but it didn’t work. How can I do that?
Although we do allow the collect period to be configured, unfortunately it’s not wired up at the moment. You can see where it could/should be wired up, it’s just a matter of doing it.
I think the best way forward is to raise a bug so it can be prioritised.
I could have sworn you could manually trigger the collect-metrics hook tool with juju run so that you can trigger it to speed up during development. Perhaps @cmars can suggest the best practice for aiding development if that’s the goal.
I tried to force the execution of collect-metrics but the hook returns “ERROR cannot record metric: metrics not allowed in this context”, any suggestion?
used command:
juju run -a testtimetwo-b-essence-ims-vdu-ab hooks/collect-metrics
full output:
ERROR cannot record metric: metrics not allowed in this context
hooks/collect-metrics:65: YAMLLoadWarning: calling yaml.load() without Loader=… is deprecated, as the default Loader is unsafe. Please read https://msg.pyyaml.org/load for full details.
doc = yaml.load(f)
Traceback (most recent call last):
File “hooks/collect-metrics”, line 68, in
check_call(command)
File “/usr/lib/python3.5/subprocess.py”, line 581, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command ‘[‘add-metric’, ‘preregistered_users=0’, ‘users_in_dialog=0’, ‘users=5027’]’ returned non-zero exit status 1
It’s a custom charm.
I want OSM to collect the metrics, so if I execute the command defined in metrics.yaml the metric is not going to be stored.
thanks anyways