Hi,
I'm trying to create a custom metric for Skyline. I'm following Skyline Administration Guide - Custom Metric but much like Adam_Kouril in his Post I noticed the deviation of the documentation and actual behavior.
I came to the conclusion that in the configuration json, its seems like the expect value for the command key is the path to script that outputs the metrics in its original location. When adding it as metric the script is moved to /var/log/CPotlpAgent/backup/scripts and the command is rewritten to the new path (According to the output of sklnctl otlp config).
Nonetheless I get this error message and no custom metric:
/opt/CPotlpAgent/otlp_agent.log
caller=level.go:63 ts=2025-04-30T05:02:10.200-04:00 caller=level.go:63 level=error msg="Script: is missing command"
caller=level.go:63 level=error msg="Script: /home/admin/test_metric was not added due to: " Scriptdoesnothasacommand=(MISSING)
test-metric.json
{
"state" : "enabled",
"command" : "/home/admin/test_metric.sh",
"desc" : "Testing the custom metric feature",
"name" : "custom.metric",
"type" : "Gauge",
"unit" : "1",
"interval" : 10
}
test_metric.sh
#!/bin/bash
. /opt/CPotlpAgent/cs_data_handler_is.bash
VALUE=$(($RANDOM % 5))
set_ot_object new value $VALUE
set_ot_object last label test hello
script_exit "Finished running" 0
Versions:
HOTFIX_R81_20_JUMBO_HF_MAIN Take: 92
BUNDLE_CPOTLPAGENT_AUTOUPDATE Take: 50
BUNDLE_CPOTELCOL_AUTOUPDATE Take: 129
I would appreciate any help or suggestions!
Kind regards
jamoin